Investigating the use of analysis contracts to improve the testability of object-oriented code

被引:34
作者
Briand, LC [1 ]
Labiche, Y [1 ]
Sun, H [1 ]
机构
[1] Carleton Univ, Software Qual Engn Lab, Ottawa, ON K1S 5B6, Canada
关键词
object-oriented testing; testability; contracts; object-oriented analysis;
D O I
10.1002/spe.520
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
dA number of activities involved in testing software are known to be difficult and time consuming. Among them is the definition and coding of test oracles and the isolation of faults once failures have been detected. Through a thorough and rigorous empirical study, we investigate how the instrumentation of contracts could address both issues. Contracts are known to be a useful technique in specifying the precondition and postcondition of operations and class invariants, thus making the definition of object-oriented analysis or design elements more precise. It is one of the reasons the Object Constraint Language (OCL) was made part of the Unified Modeling Language. Our aim in this paper is to reuse and instrument contracts to ease testing. A thorough case study is run where we define OCL contracts, instrument them using a commercial tool and assess the benefits and limitations of doing so to support the automated detection of failures and the isolation of faults. As contracts can be defined at various levels of detail, we also investigate the cost and benefit of using contracts at different levels of precision. We then draw practical conclusions regarding the applicability of the approach and its limitations. Copyright (C) 2003 John Wiley Sons, Ltd.
引用
收藏
页码:637 / 672
页数:36
相关论文
共 25 条
[1]  
[Anonymous], 1999, TESTING OBJECT ORIEN
[2]  
[Anonymous], 2001, DESIGN CONTRACT EXAM
[3]  
Baudry B, 2000, SEVENTH INTERNATIONAL SOFTWARE METRICS SYMPOSIUM - METRICS 2001, PROCEEDINGS, P272, DOI 10.1109/METRIC.2001.915535
[4]   Building trust into OO components using a genetic analogy [J].
Baudry, B ;
Le Hanh, V ;
Jézéquel, JM ;
Le Traon, Y .
11TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING, PROCEEDINGS, 2000, :4-14
[5]  
Beizer B., 2003, Software Testing Techniques
[6]   An empirical evaluation of statistical testing designed from UML state diagrams:: The Flight Guidance System case study [J].
Chevalley, P ;
Thévenod-Fosse, P .
12TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING, PROCEEDINGS, 2001, :254-263
[7]  
Coleman D., 1994, Object-Oriented Development: The Fusion Method
[8]  
COUSOT P, 2000, P SSGRR 2000 COMP EB
[9]  
EISENSTADT M, 1997, COMMUN ACM, V40, P31
[10]   Reliable objects:: Lightweight testing for OO languages [J].
Jézéquel, JM ;
Deveaux, D ;
Le Traon, Y .
IEEE SOFTWARE, 2001, 18 (04) :76-+