A Study on Software Testability and the Quality of Testing in Object-Oriented Systems

Total Page:16

File Type:pdf, Size:1020Kb

A Study on Software Testability and the Quality of Testing in Object-Oriented Systems A Study on Software Testability and the Quality of Testing In Object-Oriented Systems By Amjed Abdalhamed Abbas Tahir A THESIS SUBMITTED IN FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY IN THE UNIVERSITY OF OTAGO This thesis is dedicated to the loving memory of my father, Abdalhmed, who taught me to always believe in myself. Gone but not forgotten! my mother, Amnah, for her constant love and support. I Abstract Software testing is known to be important to the delivery of high-quality systems, but it is also challenging, expensive and time-consuming. This has motivated academic and industrial researchers to seek ways to improve the testability of software. Software testability is the ease with which a software artefact can be effectively tested. The first step towards building testable software components is to understand the factors – of software processes, products and people – that are related to and can influence software testability. In particular, the goal of this thesis is to provide researchers and practitioners with a comprehensive understanding of design and source code factors that can affect the testability of a class in object oriented systems. This thesis considers three different views on software testability that address three related aspects: 1) the distribution of unit tests in relation to the dynamic coupling and centrality of software production classes, 2) the relationship between dynamic (i.e., runtime) software properties and class testability, and 3) the relationship between code smells, test smells and the factors related to smells distribution. The thesis utilises a combination of source code analysis techniques (both static and dynamic), software metrics, software visualisation techniques and graph-based metrics (from complex networks theory) to address its goals and objectives. A systematic mapping study was first conducted to thoroughly investigate the body of research on dynamic software metrics and to identify issues associated with their selection, design and implementation. This mapping study identified, evaluated and classified 62 research works based on a pre-tested protocol and a set of classification criteria. Based on the findings of this study, a number of dynamic metrics were selected and used in the experiments that were then conducted. The thesis demonstrates that by using a combination of visualisation, dynamic analysis, static analysis and graph-based metrics it is feasible to identify central classes and to diagrammatically depict testing coverage information. Experimental results show that, even in projects with high test coverage, some classes appear to be left without any direct unit testing, even though they play a central role during a typical execution profile. It is II contended that the proposed visualisation techniques could be particularly helpful when developers need to maintain and reengineer existing test suites. Another important finding of this thesis is that frequently executed and tightly coupled classes are correlated with the testability of the class – such classes require larger unit tests and more test cases. This information could inform estimates of the effort required to test classes when developing new unit tests or when maintaining and refactoring existing tests. An additional key finding of this thesis is that test and code smells, in general, can have a negative impact on class testability. Increasing levels of size and complexity in code are associated with the increased presence of test smells. In addition, production classes that contain smells generally require larger unit tests, and are also likely to be associated with test smells in their associated unit tests. There are some particular smells that are more significantly associated with class testability than other smells. Furthermore, some particular code smells can be seen as a sign for the presence of test smells, as some test and code smells are found to co-occur in the test and production code. These results suggest that code smells, and specifically certain types of smells, as well as measures of size and complexity, can be used to provide a more comprehensive indication of smells likely to emerge in test code produced subsequently (or vice versa in a test-first context). Such findings should contribute positively to the work of testers and maintainers when writing unit tests and when refactoring and maintaining existing tests. III Acknowledgements I would like to express my gratitude to a number of people who supported me throughout my PhD journey. Firstly, I would like to express my sincere gratitude to my primary supervisor Prof Stephen MacDonell for his guidance and support throughout the course of my PhD (and other related) research. Steve has been a constant source of motivation during every stage of my research. I would like also to thank my secondary supervisor Prof Michael Winikoff for his advice, guidance and for reading drafts and providing feedback during later stages of this thesis. I am extremely grateful to my mother, Amnah, and all my siblings (Adil, Adnan, Adlah, Abbas, and Ammar) and their young families for their encouragement and unlimited support (especially spiritually) throughout my PhD journey and my life in general. I could not have done it without your support, so thank you all! I would like to especially thank Abbas for his inspiration and for the many technical discussions which have improved the outcomes of this thesis. I thank my fellow colleagues and lab-mates at the University of Otago (and previously at AUT): Sherlock Licorish, Michael Bosu and Aftab Mughal. They have certainly helped me in making this PhD experience an enjoyable one. I also thank all fellow PhD students at the Department of Information Science for the lively discussions we had whenever we get together. In particular, I would like to thank M. Alghamdi, A. Alshaer, M. Farhangian and H. Lin. I would like also to thank my fellow colleagues and members of the Software Engineering Research Laboratory at Auckland University of Technology, whom I shared space with during my time at AUT: Frederik Schmidt, Bilal Raza, Nadia Kasto, Minjuan Tong, Waqar Husin, Da Zhang and Dr Jacqui Whalley. I would like to especially thank Jim Buchan for his feedback and collaboration during various stages of this PhD journey. I am grateful for the financial support I received from University of Otago (Otago’s Business School Dean Scholarship) and previously from AUT (SERL special PhD Scholarship). IV Last but not least, I would like to thank all my friends (around the world!) for their moral help and support, and for their understanding during my PhD journey. I am lucky to have such friends! Thank you all… Amjed Tahir July 2015 V Table of Contents Abstract ............................................................................................................................... II Acknowledgements ......................................................................................................... IV List of Tables .................................................................................................................... IX List of Figures ................................................................................................................... XI Acronyms ....................................................................................................................... XIII Chapter 1 Introduction ..................................................................................................... 1 1.1. Background and Motivation ................................................................................. 1 1.2. Research Goal and Objectives ............................................................................... 2 1.3. Main Outcomes ....................................................................................................... 4 1.4. List of Publications ................................................................................................. 5 1.5. Structure of the Thesis ............................................................................................ 6 Chapter 2 Literature Review ........................................................................................ 8 2.1 Introduction ............................................................................................................. 8 2.2 Software Testability .............................................................................................. 10 2.2.1 Testability Definitions ................................................................................... 11 2.2.2 Testability Factors .......................................................................................... 13 2.3 Software Measurement and Metrics .................................................................. 14 2.3.1 Static Metrics .................................................................................................. 15 2.3.2 Dynamic Metrics ............................................................................................ 16 2.4 Program Comprehension .................................................................................... 22 2.4.1 Test Comprehension...................................................................................... 23 2.4.2 Test and Code Smells .................................................................................... 25 Chapter 3 Research Methodology ............................................................................
Recommended publications
  • Download, but We Did Not Check That Aspect for Each Tool
    A survey on software testability Vahid Garousi Michael Felderer Feyza Nur Kılıçaslan Information Technology Group Blekinge Institute of Technology, Sweden & Department of Computer Engineering Wageningen University, Netherlands University of Innsbruck, Austria Hacettepe University, Ankara, Turkey [email protected] [email protected] [email protected] Abstract: Context: Software testability is the degree to which a software system or a unit under test supports its own testing. To predict and improve software testability, a large number of techniques and metrics have been proposed by both practitioners and researchers in the last several decades. Reviewing and getting an overview of the entire state-of-the-art and state-of-the- practice in this area is often challenging for a practitioner or a new researcher. Objective: Our objective is to summarize the body of knowledge in this area and to benefit the readers (both practitioners and researchers) in preparing, measuring and improving software testability. Method: To address the above need, the authors conducted a survey in the form of a systematic literature mapping (classification) to find out what we as a community know about this topic. After compiling an initial pool of 303 papers, and applying a set of inclusion/exclusion criteria, our final pool included 208 papers. Results: The area of software testability has been comprehensively studied by researchers and practitioners. Approaches for measurement of testability and improvement of testability are the most-frequently addressed in the papers. The two most often mentioned factors affecting testability are observability and controllability. Common ways to improve testability are testability transformation, improving observability, adding assertions, and improving controllability.
    [Show full text]
  • ALIGNMENT of OPEN SOURCE TOOLS with the NEW ISO 25010 STANDARD Focus on Maintainability
    ALIGNMENT OF OPEN SOURCE TOOLS WITH THE NEW ISO 25010 STANDARD Focus on Maintainability Emanuel Irrazábal, Javier Garzás University Rey Juan Carlos, Madrid, Spain Kybele Consulting S. L., Madrid, Spain Esperanza Marcos University Rey Juan Carlos, Madrid, Spain Keywords: ISO 25010, Maintainability, Tools, Product metrics. Abstract: Nowadays, quality and especially software product quality is becoming a hot topic in the context of Software Engineering. In this context, measures provide the basis for the improvement and, in particular, code measures provide direct visibility of product quality. Nevertheless, some organizations cannot afford these tools. Several studies have revealed that applying quality models in Small and Medium-Sized enterprises (SMEs) is a very challenging task. Related to this, open-source tools emerge as the answer to provide with the technical support to collect the information needed to assess the quality of software assets. In this work, we review how existing open-source tools fulfill the needs for quality measures raised when you want to assess product quality according to the new ISO/IEC 25010 standard, which has introduced changes in the characteristics of model quality over the previous model. We have focused on the characteristic of maintainability because of its historical significance and its direct impact on total costs. 1 INTRODUCTION Basically, the product quality model identifies quality characteristics and how they are decomposed Quality is currently recognized by companies as a into subcharacteristics. In this work we focus on one major asset to improve their competitiveness. At the of them: maintainability, since it has been same time it has become an essential requirement to historically recognised as one of the most relevant ensure that the processes and products developed issues given its direct impact over the cost of meet the needs of the customer.
    [Show full text]
  • Metric Based Testability Estimation Model for Object Oriented Design: Quality Perspective
    Journal of Software Engineering and Applications, 2015, 8, 234-243 Published Online April 2015 in SciRes. http://www.scirp.org/journal/jsea http://dx.doi.org/10.4236/jsea.2015.84024 Metric Based Testability Estimation Model for Object Oriented Design: Quality Perspective Mahfuzul Huda1, Yagya Dutt Sharma Arya1, Mahmoodul Hasan Khan2 1Department of Computer Science & Engineering, Invertis University, Bareilly, India 2Department of Computer Science and Engineering, IET, Lucknow, India Email: [email protected] Received 5 April 2015; accepted 23 April 2015; published 27 April 2015 Copyright © 2015 by authors and Scientific Research Publishing Inc. This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/ Abstract The quality factor of class diagram is critical because it has significant influence on overall quality of the product, delivered finally. Testability has been recognized as a key factor to software quality. Estimating testability at design stage is a criterion of crucial significance for software designers to make the design more testable. Taking view of this fact, this paper identifies testability factors namely effectiveness and reusability and establishes the correlation among testability, effective- ness and reusability and justifies the correlation with the help of statistical measures. Moreover study developed metric based testability estimation model and developed model has been vali- dated using experimental test. Subsequently, research integrates the empirical validation of the developed model for high level acceptance. Finally a hypothesis test performs by the two stan- dards to test the significance of correlation. Keywords Testability, Testability Model, Effectiveness, Reusability, Testability Factors, Design Phase 1.
    [Show full text]
  • Testability As a Measure for Improving Software Quality in System Analysis
    Article Kardan Journal of Engineering and Testability as a Measure Technology for Improving Software 1 (1) 48–57 Quality in System Analysis ©2019 Kardan University and Design Kardan Publications Kabul, Afghanistan https://kardan.edu.af/Research/Kardan _journal_of_engineering_and_technol Irfanullah Khan ogy.aspx# Abdul Khaliq Khan Shinwari Zaidullah Abstract Software quality assurance is being an emerging field of software engineering, advocating more stable solutions to real-world systems strongly. SQA is a formal procedure used to evaluate, document, and assure the quality of the work products at all phases of SDLC. Different factors may affect the quality of the system. The primary purpose of this research is to identify and understand various quality factors and their effect on software/system development. The relationships between these factors and SDLC phases are investigated, and another quality factor testability is proposed to the quality factor set of the system analysis & design. The expected results of the proposed solution have shown the importance of testability, specifically at system analysis & design phase of software/system development. Keywords: Software Quality, system analysis & design, testability Mr. Irfanullah Khan, Assistant Professor at Kardan University, Kabul, Afghanistan. Mr. Abdul Khaliq Khan Shinwari, Assistant Professor at Kardan University, Kabul, Afghanistan. Mr. Zaidullah, Assistant Professor at Kohat University of Science and Technology, Kohat, Pakistan 48 Khan, Shinwari and Zaidullah (2019) Introduction Software quality assurance is becoming one of the emerging fields of software engineering and a formal technique to assure, evaluate, and document quality. This technique can be used in every phase of SDLC to assure the software product quality. In modern software development, SQA is very critical as it ensures the quality of processes and methods being used in software engineering.
    [Show full text]
  • An Empirical Study on Testability Measurement of Object Oriented Software M.A
    International Journal of Scientific & Engineering Research, Volume 6, Issue 5, May-2015 1285 ISSN 2229-5518 An Empirical Study on Testability Measurement of Object Oriented Software M.A. Khanum, Arun Mani Tripathi2 Associate Professor, Department of Computer Application , Integral University, Lucknow,India 1 M.tech student, C.S.E., Integral University, Lucknow, 2 Abstract: Testability has always been a difficult exercise and its accurate estimation or assessment a complex exercise. Most of the studies quantify testability or more specifically the attributes that have influence on software testability but at the implementation level. A decision to transform the design in order to improve software testability after implementation has started may be very error prone and expensive. While estimating testability early in the software development life cycle may significantly reduce the overall development cost. In this paper Testability has been recognized as a major factor to object oriented software quality and importance is being drawn to measure design testability, near the beginning in the software development process. Study identified effectiveness and flexibility are the major factors that affect overall testability at design phase. The identified testability factors are to be correlated with the object oriented design characteristics. After successfully establishing the relationship, study developed Testability Measurement Model for Object Oriented Design. Subsequently testability model has been empirically validated and contextual interpretation has been performed using try out software projects. Keywords: Testability, Flexibility, Effectiveness, Testability Model —————————— —————————— external quality attribute that estimates the complexity and I. INTRODUCTION the required effort for software testing. Software testability Software systems are fastest emerging trend in the real is a main aspect to permit the detection of difficulties to world and the probable possibilities concerning the uncover defects in software.
    [Show full text]
  • Testability Assessment Model for Object Oriented Software Based on Internal and External Quality Factors by Harsha Singhani & Dr
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Global Journal of Computer Science and Technology (GJCST) Global Journal of Computer Science and Technology: C Software & Data Engineering Volume 15 Issue 5 Version 1.0 Year 2015 Type: Double Blind Peer Reviewed International Research Journal Publisher: Global Journals Inc. (USA) Online ISSN: 0975-4172 & Print ISSN: 0975-4350 Testability Assessment Model for Object Oriented Software based on Internal and External Quality Factors By Harsha Singhani & Dr. Pushpa R. Suri Kurukshetra University, India Abstract- Software testability is coming out to be most frequent talked about subject then the underrated and unpopular quality factor it used to be in past few years. The correct and timely assessment of testability can lead to improvisation of software testing process. Though many researchers and quality controllers have proved its importance, but still the research has not gained much momentum in emphasizing the need of making testability analysis necessary during all software development phases. In this paper we review and analyse the factors affecting testability estimation of object oriented software systems during design and analysis phase of development life cycle. These factors are then linked together in the form of new assessment model for object oriented software testability. The proposed model will be evaluated using analytical hierarchical process (AHP). Keywords: software testability, testability factors, object oriented software testability
    [Show full text]
  • Effect of Refactoring on Software Quality
    EFFECT OF REFACTORING ON SOFTWARE QUALITY Noble Kumari 1 and Anju Saha 2 1 USICT, Dwarka, Delhi, India [email protected] 2USICT, Dwarka, Delhi, India [email protected] ABSTRACT Software quality is an important issue in the development of successful software application. Many methods have been applied to improve the software quality. Refactoring is one of those methods. But, the effect of refactoring in general on all the software quality attributes is ambiguous. The goal of this paper is to find out the effect of various refactoring methods on quality attributes and to classify them based on their measurable effect on particular software quality attribute. The paper focuses on studying the Reusability, Complexity, Maintainability, Testability, Adaptability, Understandability, Fault Proneness, Stability and Completeness attribute of a software .This, in turn, will assist the developer in determining that whether to apply a certain refactoring method to improve a desirable quality attribute. KEYWORDS Metrics, Refactoring, Attributes & External software quality attributes. 1. INTRODUCTION Refactoring is defined as the "process of improving the design of existing code by changing its internal structure without affecting its external behavior" [7, 8].The poorly designed code is harder to maintain, test and implement and hence the quality of software degrades. The basic goal of refactoring is the safe transformation of the program to improve the quality. The benefit of undertaking refactoring includes improvement of external software quality attributes. In software program the word “smell” means potential problem in the code. In the refactoring cycle as the smell is found, refactoring methods are applied and code is improved. The cycle continues till we find the maximum efficient code [8].
    [Show full text]
  • Possibility of Reuse in Software Testing Manjari Gupta Meeta Prakash
    Possibility of Reuse in Software Testing “6th annual International Software Testing Conference in India 2006” Manjari Gupta Dept. of Comp. Engg., Institute of Technology, Banaras Hindu University, Varanasi-221 005 [email protected] Meeta Prakash [email protected] 1 ABSTRACT Testing of software is considered to be the most important component of software quality assurance process. The inherent errors that are left behind in a software code, will eventually lead to a lot of software failures. There is a possibility of applying reuse techniques in testing, as reuse is well known as a means for improving software quality and productivity. Unfortunately, software reuse and testing, both, are areas that are generally neglected by the professionals, during the development, because of various constraints and limitations. Reuse is useful and Testing is an important task, then it is obvious to get interested in and be concerned with the application of reuse in software testing. To get the maximum benefit of reuse, it should ideally be implemented in all the phases of software development rather than only at coding. Since testing phase is considered as the most difficult and time consuming, it may be possible to reduce the total software development cost, by applying reuse in the testing phase. This work identifies various possibilities of reuse in the testing process. Different kinds of reusable testing artifacts are highlighted, and the categorization of these artifacts in reuse repository is explained. KEY WORDS Software reuse, Software testing, Test design patterns, Test environments, Test reuse repository. 1. INTRODUCTION Quality assurance is an important issue in software development that is mainly achieved by testing among others like design reviews, formal specifications, model checking and inspection etc.
    [Show full text]
  • Testability in Software Engineering Ppt
    Testability in software engineering ppt Testability: The capability of the software product to enable modified software to you ask – e.g. pilots, airplane construction engineers, or airplane designers? A Software Engineering Research Group Literature Study . Testability is defined in the IEEE glossary of software engineering [25] as;. Definition of Software Testability. Why Testability Matters? Design for Testability! What Makes an SUT Testable? Testability-Explorer Tool. Basic concepts of software testability; Understanding component testability . refers to all engineering activities to enhance component testability for software. Introduction to Software Quality Assurance & Testing Software Engineering, 5th Ed., Roger Pressman Completeness, Consistency, Feasibility, Testability. if software can be controlled better the it is more that testing can be automated and optimized. 7. Software Testability Checklist - 2. Decomposability. controlling. This paper is about design for testability, the main intersection of software design . Solution: Adhere to the general software engineering principles on how to. These slides are designed to accompany Software Engineering: A Testability. ▫ Operability —it operates cleanly. ▫ Observability—the results of each test case. Assign your best people to testing; Ensure that testability is a key objective in your Provides early feedback to software engineers; Results in formal validation. Seems like in Software Engineering we concentrate on capturing, designing, implementing, and deploying with emphasis Maintainability; flexibility; testability. Techniques for building testable components. Regression Testing of What is Component Based Software Engineering (CBSE)?. This approach is based on. The knowledge as to whether a software component is testable or not is important to the To Appear in the IEEE Transactions on Software Engineering, Vol. Reliability; Portability; Efficiency; Human Engineering.
    [Show full text]
  • Object Oriented Software Testability (OOST) Metrics Analysis
    International Journal of Computer Applications Technology and Research Volume 4– Issue 5, 359 - 367, 2015, ISSN:- 2319–8656 Object Oriented Software Testability (OOST) Metrics Analysis Pushpa R. Suri Harsha Singhani Department of Computer Science and Institute of Information Technology & Applications, Kurukshetra University, Management (GGSIPU), Janak Puri, New Kurukshetra -136119, Haryana, India Delhi -110058, India Abstract: One of the core quality assurance feature which combines fault prevention and fault detection, is often known as testability approach also. There are many assessment techniques and quantification method evolved for software testability prediction which actually identifies testability weakness or factors to further help reduce test effort. This paper examines all those measurement techniques that are being proposed for software testability assessment at various phases of object oriented software development life cycle. The aim is to find the best metrics suit for software quality improvisation through software testability support. The ultimate objective is to establish the ground work for finding ways reduce the testing effort by improvising software testability and its assessment using well planned guidelines for object-oriented software development with the help of suitable metrics. Keywords: Software Testability, Testability Metrics, Object Oriented Software Analysis, OO Metrics 1. INTRODUCTION object oriented software testability (OOST) from Design to Implementation phase, focusing on the strengths and The testing phase of the software life-cycle is extremely cost weaknesses of each existing proposal. Thus, researchers can intensive 40% or more of entire resources from designing have a broad insight into the work already done. through implementation to maintenance are often spent on testing[1].This is due to the enlargement of software scale and Another aim of this work is to help reveal areas of research complexity, leading to increasing testing problems.
    [Show full text]
  • Chapter 4. Understanding Quality Attributes with Felix Bachmann and Mark Klein
    Página 1 de 24 [ Team LiB ] Chapter 4. Understanding Quality Attributes with Felix Bachmann and Mark Klein Note: Felix Bachmann and Mark Klein are senior members of the technical staff at the Software Engineering Institute. "Cheshire-Puss," [Alice] began, rather timidly … "Would you tell me, please, which way I ought to go from here?" "That depends a good deal on where you want to go to," said the Cat. "Oh, I don't much care where—" said Alice. Then it doesn't matter which way you go," said the Cat. "—so long as I get somewhere," said Alice. "Oh, you're sure to do that," said the Cat, "if only you walk long enough." —Lewis Carroll, Alice's Adventures in Wonderland. As we have seen in the Architecture Business Cycle, business considerations determine qualities that must be accommodated in a system's architecture. These qualities are over and above that of functionality, which is the basic statement of the system's capabilities, services, and behavior. Although functionality and other qualities are closely related, as you will see, functionality often takes not only the front seat in the development scheme but the only seat. This is short-sighted, however. Systems are frequently redesigned not because they are functionally deficient—the replacements are often functionally identical—but because they are difficult to maintain, port, or scale, or are too slow, or have been compromised by network hackers. In Chapter 2, we said that architecture was the first stage in software creation in which quality requirements could be addressed. It is the mapping of a system's functionality onto software structures that determines the architecture's support for qualities.
    [Show full text]
  • A Testability Analysis Framework for Non-Functional Properties
    A Testability Analysis Framework for Non-Functional Properties Michael Felderer Francisco Gomes de Oliveira Neto Bogdan Marculescu Robert Feldt Blekinge Institute of Technology Richard Torkar Karlskrona, Sweden Chalmers and the University of Gothenburg [email protected] Gothenburg, Sweden Abstract—This paper presents background, the basic steps notion of software testability has been subject to a number and an example for a testability analysis framework for non- of different interpretations by standards and experts. In their functional properties. systematic review on software testability, Garousi et al. [2] Index Terms—testability, extra-functional properties, non- functional properties, robustness, software testing provide, overall, 33 definitions for testability extracted from different papers and standards. I. INTRODUCTION A comprehensive testability definition is provided in the Testability is a quality attribute that evaluates the effective- ISO/IEC Standard 25010 on system and software quality ness and efficiency of testing: If the testability of a software models. It defines testability as the degree of effectiveness and artifact is high, then finding faults by means of testing is easier. efficiency with which test criteria can be established for a A lower degree of testability results in increased test effort, and system, product or component and tests can be performed to thus in less testing performed for a fixed amount of time [1]. determine whether those criteria have been met. The definition While software testability has been extensively refers to the effectiveness and efficiency aspects of testability investigated—in a recent systematic literature review and makes explicit that testability is context-dependent with the authors identified 208 papers [2]—the focus has always respect to the applied test criteria and the relevant artifacts been on functional testing, while non-functional properties under test.
    [Show full text]