Software Quality Engineering
BS(SE)-VI
Dr. Assad Abbas
Department of Computer Science
Topics
n Quality in Software Construction and Coding
n Coding Standards
Introduction
n
The term
software construction
refers to
the detailed
creation of working software
through a combination of coding, verification,
unit testing, integration testing, and
Introduction
n
Software construction
closely tied
to
5
Software design
5
Software testing
Introduction
n Software construction typically produces the highest number
of configuration items that need to be managed in a software project (source files, documentation, test cases, and so on).
n Thus, the Software Construction is also closely linked to the
Introduction
n Construction is tool intensive.
n Quality (or lack thereof) is very evident in the construction
products.
n Construction is highly related to technical Computer Science
capabilities due to
5 Use of algorithms
Why should you care about code Quality?
n The developers use different jargons.n Readability: Make the code more readable and easier to comprehend for everyone working on the project. It’s much
harder to read and understand a bad quality code than to write it.
n Maintainability: It’s easier, safer and less time consuming to
maintain and test quality code.
n Lower technical debt: Good quality code can speed up
long-term software development since it can be reused and
developers don’t have to spend that much time fixing old bugs and polishing code. It also makes it easier for new project
Relationship with Software Quality
n Weinberg has identified four targets which a good program
should meet:
5 Does a program meet its specification; "correct output for each possible input"?
5 Is the program produced on schedule (and within budget)?
5 How adaptable is the program to cope with changing requirements?
What’s Wrong With Software Construction?
n Historically a “write-only” exercise: If it doesn’t break, no one
else reads it.
n Ad-hoc or absent standards.
n Testing as a separate exercise.
n Re-work (patch) to fix defects (“bugs”). n Features take precedence over quality. n Definition of quality is not rigorous.
What’s Missing in Software Construction?
n
If we built buildings this way….
n
They might not stay standing!!
09/22/2020
Buildings are not built this way, Building construction has Standards!
n Typical Building Requirements:
5 Building Heights and Areas
5 Types of Construction
5 Soils and Foundations
5 Fire-Resistance and Fire Protection Systems
5 Means of Egress
5 Accessibility
5 Interior Finishes and Environment
5 Energy Efficiency
5 Exterior Walls
5 Roof Assemblies
5 Rooftop Structures
5 Structural Design
5 Materials (Concrete, Steel, Wood, etc.)
Missing: the “Building Code” for software
n There is a lack of uniformity and standards.
n Historically, these are created in an ad hoc manner
by each organization.
n There is no penalty for inadequate standards.
n Best practices are often discarded under cost and
How Do We Fix This?
n We must identify and implement industry best practices. n We must enforce best practices
5 Rules
5 Requirements
n This is the way to make sure our software doesn’t burn up or
Growth of code—and complexity
• Software projects can be too complex .
• Successful software projects must control that complexity.
Construction Guidelines in Brief
n
A general overview of all of the above:
5
Know what the code block must perform
5
Maintain naming conventions which are uniform
throughout.
5
Indicate a brief description of what a variable is for
(reference to commenting)
5
Correct errors as they occur.
Software Construction Fundamentals
n Minimizing complexity n Anticipating change
n Constructing for verification n Reuse
Minimizing Complexity
n Humans are severely limited in ability to hold complex information in their working memories.
n As a result, minimizing complexity is one of the strongest drivers in software construction.
n Need to reduce complexity throughout the lifecycle.
n As functionality increases, so does complexity.
n Accomplished through use of standards.
5 Examples:
g J2EE for complex, distributed Java applications.
g UML for modeling all aspects of complex systems.
g High-order programming languages such as C++ and Java.
Anticipating Change
n Software changes over time.
n Anticipation of change affect how software is constructed. n This can effect
5 Use of control structures.
5 Handling of errors.
5 Source code organization.
5 Code documentation.
Constructing for Verification
n Construct software that allows bugs to be easily found and
fixed.
n Examples:
5 Enforce coding standards.
g Helps support code reviews
5 Unit testing.
5 Organizing code to support automated testing.
Reuse
n Reuse refers to using existing assets in solving different
problems.
5 In software construction, typical assets that are reused include libraries, modules, components, source code, and commercial off-the-shelf (COTS) assets.
n Reuse is best practiced systematically, according to a
well-defined, repeatable process.
n Systematic reuse can enable significant software productivity,
Standards in Construction
n Standards which directly affect construction issues include:
5 Programming languages
g E.g. standards for languages like Java and C++
5 Communication methods
g E.g. standards for document formats and contents
uCSV or XML, SOAP web services or HTTP POST
5 Platforms
g E.g. programmer interface standards for operating system calls, J2EE
5 Tools
g E.g. diagrammatic standards for notations like the Unified Modeling
Tasks Involved in Software Construction
n Verifying that the groundwork has been laid so that construction can
proceed successfully.
n Determining how your code will be tested.
n Designing and writing classes and routines.
n Creating and naming variables and named constants.
n Selecting control structures and organizing blocks of statements.
n Unit testing, integration testing, and debugging your own code.
n Reviewing other team members’ low-level designs and code and
having them review yours.
n Polishing code by carefully formatting and commenting it.
Inspection Error Checklist…
References
1. The Art of Software Testing. Glenford J. Myers. John Wiley & Sons, Inc.
2004.