<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unit testing with Unity and SoftDevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26031/unit-testing-with-unity-and-softdevice</link><description>Hi, 
 I&amp;#39;m currently in the process of integrating unit testing into our firmware development process. I&amp;#39;m trying to execute on-target tests with the Unity test framework, using the Nordic-modified version provided in this post. 
 This has been working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Oct 2017 15:18:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26031/unit-testing-with-unity-and-softdevice" /><item><title>RE: Unit testing with Unity and SoftDevice</title><link>https://devzone.nordicsemi.com/thread/102608?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 15:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bd60118-31fd-455a-8e54-bb6cc6cedf91</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Marcus,&lt;/p&gt;
&lt;p&gt;Seems that you are doing system level test. For that purpose I would suggest you do what we do to test fds at system level:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a simple application that take input from UART or RTT for configuration test case and data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In that application, you init the softdevice and use the data from input to run the module under test  to manipulate the flash.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the operation is finished, you can use nrfjprog to verify the flash.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We created a python script to automate providing test input and check flash output.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We don&amp;#39;t use Unity for testing at system level.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With what you provided and the error log, seems that the softdevice init wasn&amp;#39;t run properly. You may want to check if there is any error code when you call softdevice_enable() and softdevice_sys_evt_handler_set(). Have you made sure you configure RAM correctly ? softdevice_app_ram_start_get() only return the application RAM start address configured in the compiler, not the actual RAM needed fort the softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit testing with Unity and SoftDevice</title><link>https://devzone.nordicsemi.com/thread/102609?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 12:17:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c10e76f-cbaa-4d14-a5a4-e0d6983cffab</guid><dc:creator>Marcus</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I would agree that normally a unit test should isolate the module in question by replacing the interfaces it has with other modules with mock functions.&lt;/p&gt;
&lt;p&gt;However the module in question is a low-level flash driver which makes use of the FDS from the SDK to perform memory transactions in flash. To test that the memory contents are correctly being manipulated, the SoftDevice is required, and without having performed these tests I would argue that the module hasn&amp;#39;t been properly tested.&lt;/p&gt;
&lt;p&gt;Mocking SoftDevice function calls so that they retain their core functionality is an option, but would probably take a lot of work. I suppose you could also argue that, as Nordic are already unit testing the SDK modules, that there&amp;#39;s no need for me to go that low-level with my tests and I can just drop the calls in as-is - but that seems a little risky in my opinion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit testing with Unity and SoftDevice</title><link>https://devzone.nordicsemi.com/thread/102607?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 13:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a84eb2c-b4f7-4b6b-82e6-e6caf3346837</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Marcus,&lt;/p&gt;
&lt;p&gt;Normally, when you unit test a module, you would need to create mock functions outside of the module that being tested. This is applied also for the softdevice API called from the module.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what we do when we do unit test for our SDK. We check the params passed to the Softdevice API  are correct, check if the APIs called correct number of time and in correct order, etc.&lt;/p&gt;
&lt;p&gt;I assume in your case, you are doing on-target testing and you actually need the device to operate to test ? shouldn&amp;#39;t it be at system level test, not unit test ? Could you share some more information ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit testing with Unity and SoftDevice</title><link>https://devzone.nordicsemi.com/thread/102610?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 15:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0c0082f-a3c3-4775-9f1d-82684fc705bb</guid><dc:creator>Yaniv Nis</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We are working at &lt;a href="https://jumper.io"&gt;Jumper&lt;/a&gt;  on a virtual device framework that enables what you need. Contact me at yaniv@jumper.io so I&amp;#39;ll better understand your needs and I&amp;#39;ll add you to our free beta program.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Yaniv&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>