
From Requirements to Automated Acceptance Tests of Interactive Apps: An Integrated Model-based Testing Approach Daniel Maciel1, Ana C. R. Paiva1, Alberto Rodrigues da Silva2 1INESC TEC, Faculdade de Engenharia da Universidade do Porto, Porto, Portugal 2INESC-ID, Instituto Superior Tecnico,´ Universidade de Lisboa, Lisboa, Portugal [email protected], [email protected], [email protected] Keywords: Requirements Specification Language (RSL), Test Case Specification, Model-based Testing (MBT), Test Case Generation, Test Case Execution Abstract: Frequently software testing tends to be neglected at the beginning of the projects, only performed on the late stage. However, it is possible to benefit from combining requirement with testing specification activities. On one hand, acceptance tests specification will require less manual effort since they are defined or generated au- tomatically from the requirements specification. On the other hand, the requirements specification itself will end up having higher quality due to the use of a more structured language, reducing typical problems such as ambiguity, inconsistency and incorrectness. This research proposes an approach that promotes the practice of tests specification since the very beginning of projects, and its integration with the requirements specification itself. It is a model-driven approach that contributes to maintain the requirements and tests alignment, namely between requirements, test cases, and low-level automated test scripts. To show the applicability of the ap- proach, two complementary languages are adopted: the ITLingo RSL that is particularly designed to support both requirements and tests specification; and the Robot language, which is a low-level keyword-based lan- guage for the specification of test scripts. The approach includes model-to-model transformation techniques, such as test cases into test scripts transformations. In addition, these test scripts are executed by the Robot test automation framework. 1 INTRODUCTION scope, and support future system maintenance activi- ties. The problem is that the manual effort required to produce requirements specifications is high and it suf- Software systems are constantly evolving becoming fers from problems, such as, incorrectness, inconsis- more complex, which increases the need for efficient tency, incompleteness, and ambiguity (Kovitz, 1998; and regular testing activity to ensure quality and in- Robertson and Robertson, 2006; Pohl, 2010). crease the product confidence. Software systems’ quality is usually evaluated by the software prod- ITLingo is a long term initiative with the goal uct’s ability to meet the implicit and explicit customer to research, develop and apply rigorous specification needs. For this purpose, it is important that customers languages in the IT domain, namely Requirements and developers achieve a mutual understanding of the Engineering, Testing Engineering and Project Man- features of the software that will be developed. agement (Silva, 2018). ITLingo adopts a linguistic Requirements Engineering (RE) intends to pro- approach to improve the rigorous of technical docu- vide a shared vision and understanding of systems mentation (e.g., SRS, test case specification, project among the involved stakeholders and throughout its plans) and, as a consequence, to promote productiv- life-cycle. The system requirements specification ity through re-usability and model transformations, as (SRS) is an important document that helps to struc- well as promote quality through semi-automatic vali- ture the system’s concerns from an RE perspective dation techniques. and offers several benefits, already reported in liter- RSL (Requirements Specification Language) is ature (Cockburn, 2001; Kovitz, 1998; Robertson and a controlled natural language integrated in ITLingo Robertson, 2006; Withall, 2007), such as the estab- which helps the production of requirements specifi- lishment of an agreement between users and develop- cations in a systematic, rigorous and consistent way ers, support validation and verification of the project (da Silva, 2017). RSL includes a rich set of con- structs logically arranged into views according to RE- tem Under Test (SUT). specific concerns that exist at different abstraction This paper is organized in 6 sections. Section 2, levels, such as business, application, software or even overviews the RSL language, showing its architec- hardware levels. ture, levels of abstraction and concerns. Section 3 in- Software testing can be used to track and evaluate troduces the concepts of the selected test automation the software development process by measuring the tool, the Robot Framework. Section 4 presents the number of tests that pass or fail and by performing proposal approach with a running and illustrative ex- continuous regression testing that allows to maintain ample. Section 5 identifies and analyzes related work. the product quality alerting developers of possible de- Finally, Section 6 presents the conclusion and briefly fects as soon as the code is changed. Among differ- mention the future work. ent types of tests, acceptance tests (Christie, 2008) are those that have a greater relationship with the re- quirements. They are used to test with respect to 2 RSL LANGUAGE the user needs, requirements and business processes, and are conducted to determine whether or not a sys- ITLingo research initiative intends to develop and ap- tem satisfies the acceptance criteria and to enable ply rigorous specification languages for the IT do- users, customers or other authorized entities to deter- main, such as requirements engineering and testing mine whether or not shall accept the system (ISTQB, engineering, with the RSL (Silva et al., 2018). RSL 2015). In order to improve the acceptance testing and provides a comprehensive set of constructs that might requirements specification activities, it may be advan- be logically arranged into views according to specific tageous to perform these activities in parallel which, concerns. These constructs are defined by linguistic in addition to increasing the quality of the require- patterns and represented textually according to con- ments, also allows to reduce the time and resources crete linguistic styles. RSL is a process- and tool- spent with them. Even though, starting the testing ac- independent language, i.e., it can be used and adapted tivities at the beginning of the project when the re- by different organizations with different processes or quirements are elicited is considered a good practice, methodologies and supported by multiple types of this is not always the case because requirements elic- software tools (Silva, 2018). This paper focuses on itation and testing are separate in traditional develop- the RSL constructs particularly supportive of use case ment processes. approaches (e.g. actors, data entities and involved re- This research proposes and discusses an approach lationships). based on the Model-based Testing (MBT) technique RSL constructs are logically classified according (ISTQB, 2015) capable of promoting the initiation to two perspectives (Silva, 2018): abstraction level of testing activities earlier when specifying require- and specific concerns they address. The abstraction ments. MBT is a software testing approach that gen- levels are: business, application, software and hard- erates test cases from abstract representations of the ware levels. On the other hand, the concerns are: system, named models, either graphical (e.g., Work- active structure (subjects), behaviour (actions), pas- flow models (Boucher and Mussbacher, 2017), PBGT sive structure (objects), requirements, tests, other con- (Moreira et al., 2017; Moreira and Paiva, 2014)) or cerns, relations and sets. (This paper focuses the dis- textual (e.g., requirements documents in an interme- cussion on the requirements and tests concerns.) diate format)(Paiva, 2007). 2.1 Requirements Specification Figure 2 shows a partial view of the RSL metamodel Figure 1: Approach terminologies that defines a hierarchy of requirement types, namely: goals, functional requirement, constraint, use case, Following the Figure 1, this approach uses RSL user story and quality requirement. (This paper fo- Requirements specifications produced through a set of cuses the discussion on only the UseCase requirement constructs provided by the language according to dif- type.) ferent concerns. Then, each Requirement is aligned RSL specifications based on Use Cases can in- with RSL Test Cases specifications. From the RSL volve the definition of some views with the respective Test Cases specifications, it is possible to align and constructs and inherent relations: generate Test scripts that can be executed automati- • DataEntity view: defines the structural entities cally by the Robot1 test automation tool over the Sys- that exist in an information system, commonly as- 1http://robotframework.org/ sociated to data concepts captured and identified • DataEntityTest apply equivalence class partition- ing and boundary value analysis techniques over the domains defined for the DataEntities (Bhat and Quadri, 2015) in RSL DataEntities; • UseCaseTest explores multiple sequences of steps defined in RSL use cases’ scenarios, and asso- ciates data values to the involved data entities; • StateMachineTest apply different algorithms to Figure 2: RSL partial metamodel: The hierarchy of require- traverse the RSL state machines so that it is possi- ments ble to define different test cases that correspond to valid or invalid paths through
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-