90 likes | 192 Views
Implement Unit Test Framework for Application running on a Pocket PC 2003 device. Durga Kulkarni Cyberonics Inc August 28, 2009. Unit testing. What is a unit? Smallest testable part of an application Unit can be a group of files, a file, class or a function What is Unit testing?
E N D
Implement Unit Test Framework for Application running on a Pocket PC 2003 device Durga Kulkarni Cyberonics Inc August 28, 2009
Unit testing • What is a unit? • Smallest testable part of an application • Unit can be a group of files, a file, class or a function • What is Unit testing? • Software verification and validation method in which a programmer tests if individual units of source code are fit for use • Benefits of unit testing • Find out problems in early development stage • Use as regression testing • Simplifies integration of units
Unit testing framework • Simplifies unit testing process • Facilitates ease of adding, running unit tests • Creates diagnostic information about tests by creating success/failure report • Provides coverage information to know which part of the code is not tested yet Examples: JUnit, CPPUnit, NUnit etc.
Example of a unit test int arr[4] = {1,15,30,40}; int baseAddress = 1000; int calculateAddress(int arg) { return baseAddress+arr[arg]; } Unit test: void testCalculateAddress() { //success ASSERT_EQUAL(calculateAddress(2), 1030); //fail ASSERT_EQUAL(calculateAddress(4), 1040); //array out of bounds error. } ASSERT_EQUAL is the function provided by unit test framework which will compare 2 numbers.
Need for unit testing framework @Cyberonics • Cyberonics designs and develops Class III medical devices for Epilepsy and Depression • As per the Medical Device Software standard (IEC 62304:2006) and Cyberonics internal software development procedure, software code must be unit tested • Currently unit testing is done via debug step through and framework is lacking • Not many commercial/open source unit tests frameworks for pocket PC platform available • Customized Framework will provide ease of designing, developing and executing unit tests for C++ application running on Pocket PC 2002/2003
Requirements for unit test framework • Unit test framework • Should be easily integrated in Cyberonics code base • Language: C++ using eVC++ 4.0 IDE • Operating System: Pocket PC 2003 • Should facilitate ease of • Adding test cases • Selecting one or more tests cases to run • Should create diagnostic information such as • Test report with success/fail status, details of failures if any, timestamp for the tests, time taken for the tests etc • Coverage information (stretch goal)
Deliverables • Project plan • Requirements specification • Software architecture and detailed design document • Source code • Build documents explaining building and releasing the Unit Test framework • Unit Test Framework Validation Protocol and Report • Known anomalies and future enhancement Report • User manual with the details of usage and capabilities of the Unit Test Framework with sample tests for Cyberonics Software application
Benefits of the project • For Cyberonics • Opportunity to work with bright students • Get fresh innovative ideas to develop the unit test framework software • Finally, get a Customized unit test framework which can be used to design, develop and execute unit tests for Cyberonics C++ handheld applications • For students • Opportunity to architect a software to be used in the industry • Get the experience of the real life project by going through all the phases starting from planning to testing • Apply the testing knowledge learned in the course