SciELO - Scientific Electronic Library Online

 
vol.30 issue3Evaluating technology intelligence system efficiencyImplementing FEM-DtN for an incompressible material on an unbounded domain author indexsubject indexarticles search
Home Pagealphabetic serial listing  

Services on Demand

Journal

Article

Indicators

Related links

  • On index processCited by Google
  • Have no similar articlesSimilars in SciELO
  • On index processSimilars in Google

Share


Ingeniería e Investigación

Print version ISSN 0120-5609

Ing. Investig. vol.30 no.3 Bogotá Sept./Dec. 2010

 

Using case-based reasoning for generating functional test procedures

Martha Dunia Delgado Dapena1 , Yucely López Trujillo2 e Indira Chávez Valiente3

1 Computer Engineering. M.Sc., in Applied Computing. Ph.D., in Technical Sciences, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. Centro de estudios de ingeniería de sistemas (CEIS), School of Computer Engineering, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. marta@ceis.cujae.edu.cu

2 Computer Engineering. M.Sc., in Applied Computing. Ph.D., in Technical Sciences, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. Centro de estudios de ingeniería de sistemas (CEIS), School of Computer Engineering, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. ylopez@ceis.cujae.edu.cu

3Computer Engineering. M.Sc., in Applied Computing. Ph.D., in Technical Sciences, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. Centro de estudios de ingeniería de sistemas (CEIS), School of Computer Engineering, Insitituto Superior Politécnico "José Antonio Echevarria" (CUJAE), La Habana, Cuba. ichavez@ceis.cujae.edu.cu


ABSTRACT

This paper presents a proposal for storage structure and retrieval mechanisms used for implementing case-based reasoning (CBR) in generating functional test procedures in software projects. This proposal was based on software project t functional requirements and sets out the proposed algorithms for considering the similarity between each pair of projects as well as those leading to adapting the solution found in the case base.

Keywords: case based reasoning, software engineering, software quality, functional testing, artificial intelligence.


Received: june 5th 2009

Accepted: november 15th 2010

Introduction

The issue of software quality receives a lot of attention nowadays. Although companies devote significant resources to adopting or defining quality standards, the results have not met expectations since productivity has been low, the actual amount of resources consumed has been almost unpredictable and has almost never resulted in the required quality and professionalism. The tests to be performed (Everett, 2007) (Pressman, 2005) can be planned from the earliest stages of software life-cycle, even before reaching the codification stage. This prevents errors being inserted into an application, which can become quite difficult to find in later stages.

Despite being good practice, few are benefiting from this idea and only begin to think about the tests after having the code. Most software development teams have limited time for creating detailed and well-planned testing, consequently leading to the execution of mainly functional tests without prior planning. In these circumstances, one can think of working on accumulating experience in the computer which has been obtained from each test. Doing so, a bank of cases can be created to support new projects' testing phase and, in particular, generating test cases and procedures from others which have already been used and have led to identifying flaws in previous projects.

Software development methodologies include testing; some place more emphasis on this aspect, as in the case of test-driven development (Augustine, 2005). Other methodologies consider testing as a developmental stage that should ensure final product quality (Jacobson, 2004). Nonetheless, all proposals agree that it is an issue of paramount importance and should be planned during early stages of software development. Some studies have referred to the importance of estimating the effort associated with testing to determine automation or performance in each case (Singh and Misra 2008) and also test automation in specific environments (Xie and Memon 2007) (Masood Bhatti Ghafoor and Mathur 2009)(KO and Myers 2010). One set of proposals directly addresses the reduction of test cases (Heimdahl, 2004) (Mogyorodi, 2008) (Polo,2005) (Black, 2004); they use algorithms in which it is vital to have sufficient time for the testing stage, this being sometimes impossible.

New processes and methodologies for designing tests are available (Myers, 2004) (Guvenc, 2006) (Meyer, 2006) (Gutiérrez, 2007) (Dias, 2008) (Naslavsky, 2008) but they do not usually allow reuse of cases or previously-generated procedures.

The proposal presented in this paper only takes into account testing software requirements (functional or black box) whose main objective is to validate whether observed software behavior complies with its specifications. This work forms part of a larger project by a group of researchers and teachers from the Systems Engineering Study Center (CEIS), forming part of the Computer Science Faculty at the José Antonio Echeverría Higher Polytechnic Institute (CUJAE). Its main objective was to make proposals for planning functional tests and reusing them.

The project consisted of three phases. The first consisted of translating software requirements written in non-formal language to a list of functional requirements reduced to a verb and noun characterising the functionality in question. Several processes were carried out in the second phase generating a set of test cases and procedures for a software project based on functional tests from previous projects. A third phase reduced the set of cases and test procedures proposed in accordance with priority criteria and will be considered as a first approach to functional test planning.

This report focus on the project's second phase related to algorithms and mechanisms generating functional test procedures in a software project.

Artificial intelligence (AI) techniques were used for achieving a tool for supporting this type of decision. Case-based reasoning (CBR)) (Althoff, 2001) was used, taking into consideration that potential experts find it very difficult to establish chains of generalized rules generating test cases and test procedures for use in any type of project, and it is easier to express knowledge in terms of cases.

CBR has had applications in software engineering (Shepperd, 2003) (Ganesan, 2000) (García, 2001). Several AI techniques have been used in software testing; some examples would be analysing results using a neural network and data-mining algorithms presented by Last (Last, 2006), prioritising test cases using genetic algorithms (Elbaum, 2004) (Fraser, 2007)

Case-based reasoning for reusing test procedures on software projects

Base case structure

Information regarding the projects and all defects detected were stored in a repository presented by Delgado (Delgado, 2006). This repository had been enriched with test cases, test procedures and recovery mechanisms. The latter allowed retrieval of test cases (TC) and test procedures (TP) associated with the projects stored in the case database which were similar to a new project for which one may want to generate a TC. It should be noted that this proposal consisted of generation during early stages where input informatio was required for a new project.

It has been necessary to associate project requirements and a description of different scenarios to be considered in the functional test (functional test description - FTD). The FTD contained the order of actions involved in developing functionality and included all possible scenarios to be considered in the requirement's FDT. This entity's internal structure has been taken from Delgado's definition (2006).

The FTD was linked to each TP designed for performing functional testing and these, in turn, were referenced by each TC where they were used.

The structure defined for storing the TP is shown in Table 2. TP were identified in the project database by combining the pair (<VERB>, <NOUN>) defining its name.

The NOUN identifying the TP referred to a frame within a hierarchy of frames expressing relationships between entities in a particular domain and were used in this proposal for recovery of TP amongst similar projects. The frame structure modelling a particular entity is shown in Table 1.

At its input section, TC also referred to the TP step where the project tester had to enter values for corresponding attributes and entities. Separate storage of TP and TC ensured that the same TP could be used in various TC. As can be seen, both structures were linked to the functional logic of the requirement to be tested; they combined the order in which actions were executed, as described in the TP, with TC input values. TP were determined by the verb and the TC were determined by nouns corresponding to the entities and attributes referenced in the TC. These entities were directly related to frame hierarchy.

A set of TP patterns (Pattern_TP) based on the pattern definitions described by Delgado (2006) had to be defined to reuse information about the order of executing actions included in a new project's TP.

Each pattern represented the set of steps to be followed by the tester during test execution. For example, for specific verb such as "to register", regardless of whether one wanted to test the functionality "register student" or "register teacher", the set of steps to be executed were the same. With this definition, each TP was linked to one or more Pattern_TP, allowing such Pattern_TP to be reused in generating TP in projects having similar characteristics to those stored in the project database.

Pattern_TP formed part of a semantic network in which there were three types of relationship: "is a", "includes to" and "extends from". These types of relationships were determined by the relationship between verbs identifying each Pattern_TP. Table 4 describes the semantic meaning of these relationships where A and B were type Pattern_TP and belonged to the semantic network.

A fourth kind of relationship named "is equivalent to",expressing equivalence, existed between the verbs. For example, the verbs "register" and "create" were equivalent. All equivalent verbs were associated with a single Pattern_TP in this kind of relationship.

The Pattern_TP contained slots that could be instantiated at the time of TP adaptation in a particular project. Table 4 shows the types of slots that could be presented in a Pattern_TP and where the

Determining similarity between projects

To run the CBR system recovery phase, i.e. project recovery (cases),it was first necessary to analyse which were each software project's distinguishing features. In this case, each project requirement was considered as a trait predictor, as presented in Delgado(2006), in software project revisions.

The function of similarity between projects

f(wii(xi(O0),xi(OB)))=∑ni=lwiδi(xi(O0),Xi(OB))/∑ni=l wi   where wi was the level of importance or significance of each requirement within the new problem. This gave greater emphasis to the requirements analyst or inspector considering the most significant within the project to be reviewed.

δi(xi(O0),xi(OB))=fr((wki(zi(xi(O0)),zi(xi(OB))))2k=l ,          where

fr((wkij(zk(yi),zk(yj)))2k=l)=∑k=l2wkij(zk(yi),zk(yj)) , was the funtion evaluating similarity between a pair of requirements. This function was used to combine the similarity values between nouns and verbs and obtain the value of similarity between two requirements. A semantic network in which there were two main types of relationships, hierarchical relationships ("is a") and equivalence relations ("is equivalent to") was used for determining the similarity between nouns (and verbs). The function used for determining the similarity between verbs δij(z1(yi),z1(yj))  and between nouns δij(z2(yi),z2(yj))  was presented in Delgado (2006).

The cases compared with the new problem were stored in a linear list sorted by descending function value f . This information was used in generating a new solution.

Generating and adapting a new solution

After performing the search, the project having the highest similarity value f was used as a potential solution; it was checked that it covered all the requirements of a new project. In case not all requirements were covered, the potential solution was completed with the requirements of the second most similar case, and so on, until all the new project's requirements were completed or all recovered cases were analysed.

When a requirement from the new project xi(ON)  was associated with another from a project stored in the case database xj(ON) , the set of TC and TP which have been recovered can be assigned to the new project requirement. However, the degree of similarity between the two requirements had to be assessed to decide whether they could take the TC and TP as they appeared in the case database or whether some adaptation were needed. If the value of f was "1" TC and TP could be taken as they were because it was exactly the same requirement, otherwise two cases would deserve special treatment:

1. Value of f was [μ, 1), where μ was a threshold value. If the value of f was greater than μ then the pair of requirements was similar. Algorithm 1 (Figure 1 y 3) shows how the adjustment was made in this case.

2. Value of f was "0". No requirement found in the case database similar to the requirement of a new project. Algorithm 2 (Figure 2)shows how the adjustment was made in this case.

Two thresholds values were used in developing these algorithms to decide when a pair of verbs and a few nouns could be considered similar. They were defined for verbs μ1  and μ2  for nouns.

The TP so generated were used for generating TC for using information stored in the network of entities and the set of patterns which had been generated. The TP and TC obtained were presented to the user. Doing so, adjustments could be made to the solution and new

considerations could be incorporated, according to a new project's t specific situation. The new solution was stored in the case database as a new case.

Conclusions

This paper proposes generating functional test procedures based on the use of case-based reasoning for reusing previously generated information. The proposal's fundamental contribution lies in designing algorithms leading to the recovery and adaptation of test procedures stored in the project database and allows past experience to be taken advantage of.

However, this research is not a complete proposal; further work is being carried out on developing the remaining phases of the project to provide a solution establishing the priority in which test cases must be run, considering time constraints. At the moment, efforts are directed towards implementing a tool for experimenting during teaching to generate a test bench for checking the results to be obtainned from the proposal.

Althoff, K., Case-Based Reasoning. Handbook of Software Engineering and Knowledge Engineering., Kaiserslautern, Germany, Fraunhofer Institute for Experimental Software Engineering (IESE), 2001.        [ Links ]

Augustine, S., Managing Agile Projects. Publicaciones Prentice Hall PTR, 2005.        [ Links ]

Black, R., Pragmatic Software Testing-Becoming and Effective and Efficient Test Profesional., Publicaciones Wiley, 2007.        [ Links ]

Delgado, M., Lorenzo, I., Carralero, J., Travieso, J., Rosete, A., Una propuesta de apoyo a las Revisiones de Proyectos de Software utilizando Razonamiento Basado en Casos., Revista Iberoamericana de Inteligencia Artificial, Vol. 10, No. 30, 2006, pp. 55-68.        [ Links ]

Dias, A. C., Horta, G., Supporting the Selection of Model-based Testing., Approaches for Software Projects, AST '08: Proceedings of the 3rd international workshop on Automation of software test, ACM, mayo 2008.        [ Links ]

Elbaum, S., Rothermel, G., Malishevsky, M., Selecting a Cost-Efective Test Case Prioritization Technique., Software Quality Journal, 2004 - Springer.         [ Links ]

Everett, G. McLeod, R., Software Testing: Testing across the entire software development life cycle., John Wiley Edition, 2007.         [ Links ]

Fraser, G., Wotawa, F., Test-Case Prioritization with Model-Checkers, 25th conference on IASTED International, 2007.        [ Links ]

Ganesan, K., Khoshgoftaar, T., Allen, E., Case-Based Software Quality Prediction., International Journal of Software Engineering and Knowledge Engineering, Vol. 10, No. 2, 2000, pp. 139-152.        [ Links ]

García, F., Corchado, J., Laguna, M., CBR Applied to Development with Reuse Based on mecanos., Proceedings of the 13th International Conference on Software Engineering and Knowledge Engineering, Buenos Aires, Argentina, 2001.        [ Links ]

Gutiérrez, J., Generación automática de objetivos de prueba a partir de casos de uso mediante partición de categorías y variables operacionales., XVI Jornadas de Ingeniería del Software y Bases de Datos, JISBD07, España, 2007.          [ Links ]

Guvenc, M., Writing Testable and Code-able Requirements., Quality Software and Testing, Volumen 4, 2006.        [ Links ]

Heimdahl M., George D., Test-Suite Reduction for Model Based Tests: Effects on Test Quality and Implications for Testing., 19th IEEE International Conference on Automated Software Engineering (ASE'04), 2004, pp. 176-185.        [ Links ]

Jacobson, I., Booch, G., Rumbaugh, J., El Proceso Unificado de desarrollo de Software., Vol. 1, Editorial Félix Varela, 2004.        [ Links ]

Ko, A., Myers, B., Extracting and Answering Why and Why Not Questions about Java Program Output., ACM Transactions on Software Engineering and Methodology, Vol. 20, No. 2, Article 4, August 2010.        [ Links ]

Last, M., The Uncertainty Principle of Cross-Validation., 2006 IEEE International Conference on Granular Computing, 2006.        [ Links ]

Masood, A.,  Bhatti, R., Ghafoor, A., Mathur, A., Scalable and Effective Test Generation for Role-Based Access Control Systems., IEEE Transactions on Software Engineering, Vol. 35, No. 5, September/October 2009.        [ Links ]

Meyer, B., XP and TDD: Extreme Programing and Test-Driven Development., Chair of Software Engineering, Zurich, 2006.         [ Links ]

Mogyorodi, E., Requirements-Based Testing: Ambiguity Reviews., Testing Experience: The Magazine for Professional Testers, 2008.        [ Links ]

Myers, G. J., The Art of Software Testing., 2da Edición, Editorial John Wiley, 2004.        [ Links ]

Naslavsky, L., Ziv, H., Richardson, D., Using Model Transformation to Support Model-BasedTest Coverage Measurement., AST '08: Proceedings of the 3rd international workshop on Automation of software test, ACM, mayo 2008.        [ Links ]

Polo, M., Priorización de casos  de   prueba mediante mutación., Taller sobre Pruebas de Ingeniería del Software, PRIS 2007. Vol. 1, No. 4.        [ Links ]

Pressman, R., Ingeniería del Software: un enfoque práctico., Vol. 1, Editorial Félix Varela, 5ta edición, 2005.         [ Links ]

Shepperd, M., Case-based Reasoning and Software Engineering., Empirical Software Engineering Research Group, Universidad de Bournemouth, UK, 2003.        [ Links ]

Singh, D., Misra, A. K., Software Test Effort Estimation, ACM SIGSOFT Software Engineering Notes, Vol. 33, No. 3, May 2008.        [ Links ]

Xie, Q., Memon, A., Designing and Comparing Automated Test Oracles for GUI-Based Software Applications., ACM Transactions Software Engineering and Methodology, Vol. 16, No. 1, Article 4, Febrary 2007.        [ Links ]

Creative Commons License All the contents of this journal, except where otherwise noted, is licensed under a Creative Commons Attribution License