Abstract:
In software development lifecycle, the most likely sub-phase to be overlooked within the testing phase is unit testing. One of the main reasons for such negligence is the cost overhead of unit testing. Often, project managers and tech-leads, either ignore unit testing or carry out it in a shallow level taking the trade-off between carrying out unit testing and the cost it would incur. This research suggests a model-based unit testing specification and code generator based on model specifications. While formalisms such as the huge amount of unit test inputs, complex specifications and complex technologies exist can be used, one must consider the practical usability of the proposed solution in the industry. Generic spreadsheet-based tool is used to create the unit test specification; C++ unit test code generate for Google Test. It provides comprehensive unit test specifications, complete unit test codes and informative unit test reports. The tool is applied to five different industrial software projects with each having six target functions, (sum n=36 target functions). Results have been further validated by experienced expert architects. The evaluation confirmed that the proposed solution provides an efficient and rapid way to write error-free unit test cases and generate unit test code.