Software construction is a
software engineering discipline. It is the detailed creation of working meaningful
software through a combination of
coding,
verification,
unit testing,
integration testing
Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in software testing in which individual software modules are combined and tested as a group. Integration testing is conducted to evaluate the complianc ...
, and
debugging
In computer programming and software development, debugging is the process of finding and resolving '' bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems.
Debugging tactics can involve in ...
. It is linked to all the other
software engineering disciplines, most strongly to
software design
Software design is the process by which an agent creates a specification of a software artifact intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activity ...
and
software testing.
[ SWEBOK ]
Software construction fundamentals
Minimizing complexity
The need to reduce complexity is mainly driven by limited ability of most people to hold complex structures and information in their working memories. Reduced
complexity
Complexity characterises the behaviour of a system or model whose components interaction, interact in multiple ways and follow local rules, leading to nonlinearity, randomness, collective dynamics, hierarchy, and emergence.
The term is generall ...
is achieved through emphasizing the creation of
code
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
that is simple and readable rather than clever. Minimizing
complexity
Complexity characterises the behaviour of a system or model whose components interaction, interact in multiple ways and follow local rules, leading to nonlinearity, randomness, collective dynamics, hierarchy, and emergence.
The term is generall ...
is accomplished through making use of
standards Standard may refer to:
Symbols
* Colours, standards and guidons, kinds of military signs
* Standard (emblem), a type of a large symbol or emblem used for identification
Norms, conventions or requirements
* Standard (metrology), an object th ...
, and through numerous specific techniques in
coding. It is also supported by the
construction-focused quality techniques.
Anticipating change
Anticipating change helps software engineers build extensible software, which means they can enhance a software product without disrupting the underlying structure.
Research over 25 years showed that the cost of rework can be 10 to 100 times (5 to 10 times for smaller projects) more expensive than getting the requirements right the first time. Given that 25% of the requirements change during development on average project, the need to reduce the cost of rework elucidates the need for anticipating change.
Constructing for verification
Constructing for
verification means building
software in such a way that faults can be ferreted out readily by the
software engineers writing the
software, as well as during independent
testing
An examination (exam or evaluation) or test is an educational assessment intended to measure a test-taker's knowledge, skill, aptitude, physical fitness, or classification in many other topics (e.g., beliefs). A test may be administered verba ...
and operational activities. Specific techniques that support constructing for
verification include following coding standards to support
code reviews,
unit testing, organizing
code
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
to support
automated testing
In software testing, test automation is the use of software separate from the software being tested to control the execution of tests and the comparison of actual outcomes with predicted outcomes. Test automation can automate some repetitive bu ...
, and restricted use of complex or hard-to-
understand language structures, among others.
Reuse
Systematic reuse can enable significant software productivity, quality, and cost improvements. Reuse has two closely related facets:
* Construction for reuse: Create reusable software assets.
* Construction with reuse: Reuse software assets in the construction of a new solution.
Standards in construction
Standards, whether external (created by international organizations) or internal (created at the corporate level), that directly affect construction issues include:
* Communication methods: Such as standards for document formats and contents.
*
Programming languages
*
Coding standards
Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language. These conventions usually cover file organization, ind ...
*
Platforms
* Tools: Such as diagrammatic standards for notations like
UML
The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system.
The creation of UML was originally ...
.
Managing construction
Construction model
Numerous
models
A model is an informative representation of an object, person or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin ''modulus'', a measure.
Models c ...
have been created to develop
software, some of which emphasize construction more than others. Some
models
A model is an informative representation of an object, person or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin ''modulus'', a measure.
Models c ...
are more linear from the construction point of view, such as the
Waterfall and staged-delivery life cycle models. These
models
A model is an informative representation of an object, person or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin ''modulus'', a measure.
Models c ...
treat construction as an activity which occurs only after significant prerequisite work has been completed—including detailed
requirements
In product development and process optimization, a requirement is a singular documented physical or functional need that a particular design, product or process aims to satisfy. It is commonly used in a formal sense in engineering design, includi ...
work, extensive
design work, and detailed
planning
Planning is the process of thinking regarding the activities required to achieve a desired goal. Planning is based on foresight, the fundamental capacity for mental time travel. The evolution of forethought, the capacity to think ahead, is consi ...
. Other models are more
iterative, such as
evolutionary prototyping,
Extreme Programming, and
Scrum. These approaches tend to treat construction as an activity that occurs concurrently with other
software development
Software development is the process of conceiving, specifying, designing, programming, documenting, testing, and bug fixing involved in creating and maintaining applications, frameworks, or other software components. Software development invol ...
activities, including
requirements
In product development and process optimization, a requirement is a singular documented physical or functional need that a particular design, product or process aims to satisfy. It is commonly used in a formal sense in engineering design, includi ...
,
design, and
planning
Planning is the process of thinking regarding the activities required to achieve a desired goal. Planning is based on foresight, the fundamental capacity for mental time travel. The evolution of forethought, the capacity to think ahead, is consi ...
, or overlaps them.
Construction planning
The choice of construction
method is a key aspect of the construction planning activity. The choice of construction
method affects the extent to which construction prerequisites (e.g.
Requirements analysis,
Software design
Software design is the process by which an agent creates a specification of a software artifact intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activity ...
, .. etc.) are performed, the order in which they are performed, and the degree to which they are expected to be completed before construction work begins. Construction planning also defines the order in which
components
Circuit Component may refer to:
•Are devices that perform functions when they are connected in a circuit.
In engineering, science, and technology Generic systems
* System components, an entity with discrete structure, such as an assem ...
are created and integrated, the
software quality management processes, the allocation of task assignments to specific
software engineers, and the other tasks, according to the chosen
method.
Construction measurement
Numerous construction activities and artifacts can be measured, including code developed, code modified, code reused, code destroyed, code complexity, code inspection statistics, fault-fix and fault-find rates, effort, and scheduling. These measurements can be useful for purposes of managing construction, ensuring quality during construction, improving the construction process, as well as for other reasons.
Practical considerations
Software construction is driven by many practical considerations:
Construction design
In order to account for the unanticipated gaps in the
software design
Software design is the process by which an agent creates a specification of a software artifact intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activity ...
, during software construction some design modifications must be made on a smaller or larger scale to flesh out details of the
software design
Software design is the process by which an agent creates a specification of a software artifact intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activity ...
.
Low
Fan-out is one of the design characteristics found to be beneficial by researchers. Information hiding proved to be a useful design technique in large programs that made them easier to modify by a factor of 4.
Construction languages
Construction languages include all forms of communication by which a human can specify an executable problem solution to a computer. They include configuration languages, toolkit languages, and
programming languages:
* Configuration languages are languages in which
software engineers choose from a limited set of predefined options to create new or custom software installations.
* Toolkit languages are used to build applications out of
toolkits A toolkit is an assembly of tools; set of basic building units for user interfaces.
The word toolkit may refer to:
* Abstract Window Toolkit
* Accessibility Toolkit
* Adventure Game Toolkit
* B-Toolkit
* Battlefield Mod Development Toolkit
* Che ...
and are more complex than configuration languages.
*
Scripting languages are kinds of application programming languages that supports scripts which are often interpreted rather than compiled.
*
Programming languages are the most flexible type of construction languages which use three general kinds of notation:
** Linguistic notations which are distinguished in particular by the use of word-like strings of text to represent complex software constructions, and the combination of such word-like strings into patterns that have a sentence-like syntax.
** Formal notations which rely less on intuitive, everyday meanings of words and text strings and more on definitions backed up by precise, unambiguous, and formal (or mathematical) definitions.
** Visual notations which rely much less on the text-oriented notations of both linguistic and formal construction, and instead rely on direct visual interpretation and placement of visual entities that represent the underlying software.
Programmers working in a language they have used for three years or more are about 30 percent more productive than programmers with equivalent experience who are new to a language. High-level languages such as C++, Java, Smalltalk, and Visual Basic yield 5 to 15 times better productivity, reliability, simplicity, and comprehensibility than low-level languages such as assembly and C. Equivalent code has been shown to need fewer lines to be implemented in high level languages than in lower level languages.
Coding
The following considerations apply to the software construction coding activity:
* Techniques for creating understandable
source code, including naming and source code layout. One study showed that the effort required to debug a program is minimized when the variables' names are between 10 and 16 characters.
* Use of
classes,
enumerated types
In computer programming, an enumerated type (also called enumeration, enum, or factor in the R programming language, and a categorical variable in statistics) is a data type consisting of a set of named values called ''elements'', ''members'', ''en ...
,
variables, named
constants
Constant or The Constant may refer to:
Mathematics
* Constant (mathematics), a non-varying value
* Mathematical constant, a special number that arises naturally in mathematics, such as or
Other concepts
* Control variable or scientific const ...
, and other similar entities:
** A study done by NASA showed that the putting the code into well-factored classes can double the code
reusability compared to the code developed using functional design.
** One experiment showed that designs which access arrays sequentially, rather than randomly, result in fewer variables and fewer variable references.
* Use of control structures:
** One experiment found that loops-with-exit are more comprehensible than other kinds of loops.
** Regarding the level of nesting in loops and conditionals, studies have shown that programmers have difficulty comprehending more than three levels of nesting.
** Control flow complexity has been shown to correlate with low reliability and frequent errors.
* Handling of error conditions—both planned errors and
exceptions (input of bad data, for example)
* Prevention of code-level security breaches (
buffer overruns or
array index overflows, for example)
*
Resource usage via use of exclusion mechanisms and discipline in accessing serially reusable
resources (including
threads
Thread may refer to:
Objects
* Thread (yarn), a kind of thin yarn used for sewing
** Thread (unit of measurement), a cotton yarn measure
* Screw thread, a helical ridge on a cylindrical fastener
Arts and entertainment
* ''Thread'' (film), 2016 ...
or
database locks)
*
Source code organization (into
statements and
routines):
** Highly
cohesive
Cohesion may refer to:
* Cohesion (chemistry), the intermolecular attraction between like-molecules
* Cohesion (computer science), a measure of how well the lines of source code within a module work together
* Cohesion (geology), the part of shear ...
routines proved to be less error prone than routines with lower cohesion. A study of 450 routines found that 50 percent of the highly cohesive routines were fault free compared to only 18 percent of routines with low cohesion. Another study of a different 450 routines found that routines with the highest
coupling-to-cohesion ratios had 7 times as many errors as those with the lowest coupling-to-cohesion ratios and were 20 times as costly to fix.
** Although studies showed inconclusive results regarding the correlation between routine sizes and the rate of errors in them, but one study found that routines with fewer than 143 lines of code were 2.4 times less expensive to fix than larger routines. Another study showed that the code needed to be changed least when routines averaged 100 to 150 lines of code. Another study found that structural complexity and amount of data in a routine were correlated with errors regardless of its size.
** Interfaces between routines are some of the most error-prone areas of a program. One study showed that 39 percent of all errors were errors in communication between routines.
** Unused parameters are correlated with an increased error rate. In one study, only 17 to 29 percent of routines with more than one unreferenced variable had no errors, compared to 46 percent in routines with no unused variables.
** The number of parameters of a routine should be 7 at maximum as research has found that people generally cannot keep track of more than about seven chunks of information at once.
*
Source code organization (into
classes,
packages, or other structures). When considering
containment, the maximum number of data members in a class shouldn't exceed 7±2. Research has shown that this number is the number of discrete items a person can remember while performing other tasks. When considering
inheritance, the number of levels in the inheritance tree should be limited. Deep inheritance trees have been found to be significantly associated with increased fault rates. When considering the number of routines in a class, it should be kept as small as possible. A study on C++ programs has found an association between the number of routines and the number of faults.
*
Code documentation
Software documentation is written text or illustration that accompanies computer software or is embedded in the source code. The documentation either explains how the software operates or how to use it, and may mean different things to people in ...
* Code tuning
Construction testing
The purpose of construction testing is to reduce the gap between the time at which faults are inserted into the code and the time those faults are detected. In some cases, construction testing is performed after code has been written. In
test-first programming, test cases are created before code is written. Construction involves two forms of testing, which are often performed by the
software engineer who wrote the
code
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
:
*
Unit testing
*
Integration testing
Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in software testing in which individual software modules are combined and tested as a group. Integration testing is conducted to evaluate the complianc ...
Reuse
Implementing
software reuse entails more than creating and using
libraries of assets. It requires formalizing the practice of
reuse
Reuse is the action or practice of using an item, whether for its original purpose (conventional reuse) or to fulfill a different function ( creative reuse or repurposing). It should be distinguished from recycling, which is the breaking down of u ...
by integrating reuse processes and activities into the
software life cycle
A software release life cycle is the sum of the stages of development and maturity for a piece of computer software ranging from its initial development to its eventual release, and including updated versions of the released version to help impro ...
. The tasks related to reuse in software construction during
coding and
testing
An examination (exam or evaluation) or test is an educational assessment intended to measure a test-taker's knowledge, skill, aptitude, physical fitness, or classification in many other topics (e.g., beliefs). A test may be administered verba ...
are:
* The selection of the reusable units,
databases, test procedures, or
test data.
* The evaluation of
code
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
or test re-usability.
* The reporting of reuse information on new code, test procedures, or
test data.
Construction quality
The primary techniques used to ensure the quality of
code
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
as it is constructed include:
*
Unit testing and
integration testing
Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in software testing in which individual software modules are combined and tested as a group. Integration testing is conducted to evaluate the complianc ...
. One study found that the average defect detection rates of unit testing and integration testing are 30% and 35% respectively.
*
Test-first development
Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before software is fully developed, and tracking all software development by repeatedly testing the software against a ...
* Use of
assertions and
defensive programming
*
Debugging
In computer programming and software development, debugging is the process of finding and resolving '' bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems.
Debugging tactics can involve in ...
*
Inspections. One study found that the average defect detection rate of formal code inspections is 60%. Regarding the cost of finding defects, a study found that code reading detected 80% more faults per hour than testing. Another study shown that it costs six times more to detect design defects by using testing than by using inspections. A study by IBM showed that only 3.5 hours where needed to find a defect through code inspections versus 15–25 hours through testing. Microsoft has found that it takes 3 hours to find and fix a defect by using code inspections and 12 hours to find and fix a defect by using testing. In a 700 thousand lines program, it was reported that code reviews were several times as cost-effective as testing. Studies found that inspections result in 20% - 30% fewer defects per 1000 lines of code than less formal review practices and that they increase productivity by about 20%. Formal inspections will usually take 10% - 15% of the project budget and will reduce overall project cost. Researchers found that having more than 2 - 3 reviewers on a formal inspection doesn't increase the number of defects found, although the results seem to vary depending on the kind of material being inspected.
*
Technical reviews
A software technical review is a form of peer review in which "a team of qualified personnel ... examines the suitability of the software product for its intended use and identifies discrepancies from specifications and standards. Technical review ...
. One study found that the average defect detection rates of informal
code reviews and
desk checking
Informal methods of validation and verification are some of the more frequently used in modeling and simulation. They are called informal because they are more qualitative than quantitative. While many methods of validation or verification rely ...
are 25% and 40% respectively.
Walkthroughs were found to have defect detection rate of 20% - 40%, but were found also to be expensive specially when project pressures increase. Code reading was found by NASA to detect 3.3 defects per hour of effort versus 1.8 defects per hour for testing. It also finds 20% - 60% more errors over the life of the project than different kinds of testing. A study of 13 reviews about review meetings, found that 90% of the defects were found in preparation for the review meeting while only around 10% were found during the meeting.
*
Static analysis (IEEE1028)
Studies have shown that a combination of these techniques need to be used to achieve high defect detection rate. Other studies showed that different people tend to find different defects. One study found that the
extreme programming practices of
pair programming,
desk checking
Informal methods of validation and verification are some of the more frequently used in modeling and simulation. They are called informal because they are more qualitative than quantitative. While many methods of validation or verification rely ...
,
unit testing,
integration testing
Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in software testing in which individual software modules are combined and tested as a group. Integration testing is conducted to evaluate the complianc ...
, and
regression testing can achieve a 90% defect detection rate. An experiment involving experienced programmers found that on average they were able to find 5 errors (9 at best) out of 15 errors by testing.
80% of the errors tend to be concentrated in 20% of the project's classes and routines. 50% of the errors are found in 5% of the project's classes. IBM was able to reduce the customer reported defects by a factor of ten to one and to reduce their maintenance budget by 45% in its IMS system by repairing or rewriting only 31 out of 425 classes. Around 20% of a project's routines contribute to 80% of the development costs. A classic study by IBM found that few error-prone routines of OS/360 were the most expensive entities. They had around 50 defects per 1000 lines of code and fixing them costs 10 times what it took to develop the whole system.
Integration
A key activity during construction is the integration of separately constructed
routines,
classes,
components
Circuit Component may refer to:
•Are devices that perform functions when they are connected in a circuit.
In engineering, science, and technology Generic systems
* System components, an entity with discrete structure, such as an assem ...
, and subsystems. In addition, a particular
software system
A software system is a system of intercommunicating components based on software forming part of a computer system (a combination of hardware and software). It "consists of a number of separate programs, configuration files, which are used to se ...
may need to be integrated with other software or hardware systems. Concerns related to construction integration include planning the sequence in which
components
Circuit Component may refer to:
•Are devices that perform functions when they are connected in a circuit.
In engineering, science, and technology Generic systems
* System components, an entity with discrete structure, such as an assem ...
will be integrated, creating scaffolding to support interim
versions
Version may refer to:
Computing
* Software version, a set of numbers that identify a unique evolution of a computer program
* VERSION (CONFIG.SYS directive), a configuration directive in FreeDOS
Music
* Cover version
* Dub version
* Remix
* ''Ve ...
of the
software, determining the degree of
testing
An examination (exam or evaluation) or test is an educational assessment intended to measure a test-taker's knowledge, skill, aptitude, physical fitness, or classification in many other topics (e.g., beliefs). A test may be administered verba ...
and
quality work performed on
components
Circuit Component may refer to:
•Are devices that perform functions when they are connected in a circuit.
In engineering, science, and technology Generic systems
* System components, an entity with discrete structure, such as an assem ...
before they are integrated, and determining points in the project at which interim
versions
Version may refer to:
Computing
* Software version, a set of numbers that identify a unique evolution of a computer program
* VERSION (CONFIG.SYS directive), a configuration directive in FreeDOS
Music
* Cover version
* Dub version
* Remix
* ''Ve ...
of the
software are tested.
Construction technologies
Object-oriented runtime issues
Object-oriented languages support a series of runtime mechanisms that increase the flexibility and adaptability of the programs like
data abstraction
In software engineering and computer science, abstraction is:
* The process of removing or generalizing physical, spatial, or temporal details or attributes in the study of objects or systems to focus attention on details of greater importance ...
,
encapsulation,
modularity
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
,
inheritance,
polymorphism
Polymorphism, polymorphic, polymorph, polymorphous, or polymorphy may refer to:
Computing
* Polymorphism (computer science), the ability in programming to present the same programming interface for differing underlying forms
* Ad hoc polymorphis ...
, and
reflection.
Data abstraction is the process by which data and programs are defined with a representation similar in form to its meaning, while hiding away the implementation details. Academic research showed that data abstraction makes programs about 30% easier to understand than functional programs.
Assertions, design by contract, and defensive programming
Assertions are executable predicates which are placed in a program that allow runtime checks of the program.
Design by contract is a development approach in which preconditions and postconditions are included for each routine.
Defensive programming is the protection a routine from being broken by invalid inputs.
Error-handling, exception-handling, and fault tolerance
Error-handling refers to the programming practice of anticipating and coding for error conditions that may arise when the program runs.
Exception-handling is a programming-language construct or hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution.
Fault tolerance is a collection of techniques that increase software reliability by detecting errors and then recovering from them if possible or containing their effects if recovery is not possible.
State-based and table-driven construction techniques
State-based programming is a programming technology using finite state machines to describe program behaviors. A table-driven method is a schema that uses tables to look up information rather than using logic statements (such as if and case).
Runtime configuration and internationalization
Runtime configuration is a technique that binds variable values and program settings when the program is running, usually by updating and reading configuration files in a just-in-time mode.
Internationalization is the technical activity of preparing a program, usually interactive software, to support multiple locales. The corresponding activity,
localization, is the activity of modifying a program to support a specific local language.
See also
*
Software engineering
*
Software development
Software development is the process of conceiving, specifying, designing, programming, documenting, testing, and bug fixing involved in creating and maintaining applications, frameworks, or other software components. Software development invol ...
Notes
References
*
*
*
{{refend
External links
Guide to the Software Engineering Body of Knowledge - 2004 Version By IEEE Computer SocietyGuide to the Software Engineering Body of Knowledge, Version 3.0, IEEE Computer Society, 2014
Software engineering