Design tests: An approach to programmatically check your code against design rules

Assuring that a program conforms to its specification is a key concern in software quality assurance. Although there is substantial tool support to check whether an implementation complies to its functional requirements, checking whether it conforms to its design remains as an almost completely manual activity. In this paper, we present the concept of design tests, which are test-like programs that automatically check whether an implementation conforms to a specific design rule. Design rules are implemented directly in the target programming language in the form of tests. As a proof of concept, we present DesignWizard, an API developed to support design tests for Java programs as JUnit test cases. We applied design tests in two case studies and observed that our approach is suitable to check conformance automatically. Moreover, we observed that designers and programmers appreciate design tests as an executable documentation that can be easily kept up to date.

[1]  K. J. Lienberherr Formulations and benefits of the law of demeter , 1989 .

[2]  David Lorge Parnas,et al.  Active design reviews: principles and practices , 1985, ICSE '85.

[3]  David Notkin,et al.  Software Reflexion Models: Bridging the Gap between Design and Implementation , 2001, IEEE Trans. Software Eng..

[4]  Dalton Serey Guerrero,et al.  On the Precision and Accuracy of Impact Analysis Techniques , 2008, Seventh IEEE/ACIS International Conference on Computer and Information Science (icis 2008).

[5]  Nazareno Andrade,et al.  Labs of the World, Unite!!! , 2006, Journal of Grid Computing.

[6]  Jan Bosch,et al.  Design erosion: problems and causes , 2002, J. Syst. Softw..

[7]  C. Chambers,et al.  ArchJava: connecting software architecture to implementation , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[8]  David Garlan,et al.  Design fragments make using frameworks easier , 2006, OOPSLA '06.