Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

CHAPTER 3

SOFTWARE CONSTRUCTION

ACRONYMS Thus, the Software Construction KA is closely


linked to the Software Testing KA as well.
Application Programming Software construction typically produces the
API
Interface highest number of configuration items that need
COTS Commercial Off-the-Shelf to be managed in a software project (source files,
GUI Graphical User Interface documentation, test cases, and so on). Thus, the
Integrated Development Software Construction KA is also closely linked
IDE to the Software Configuration Management KA.
Environment
While software quality is important in all the
OMG Object Management Group KAs, code is the ultimate deliverable of a soft-
Portable Operating System ware project, and thus the Software Quality KA is
POSIX
Interface closely linked to the Software Construction KA.
TDD Test-Driven Development Since software construction requires knowledge
UML Unified Modeling Language of algorithms and of coding practices, it is closely
related to the Computing Foundations KA, which
is concerned with the computer science founda-
INTRODUCTION tions that support the design and construction of
software products. It is also related to project man-
The term software construction refers to the agement, insofar as the management of construc-
detailed creation of working software through a tion can present considerable challenges.
combination of coding, verification, unit testing,
integration testing, and debugging. BREAKDOWN OF TOPICS FOR
The Software Construction knowledge area SOFTWARE CONSTRUCTION
(KA) is linked to all the other KAs, but it is most
strongly linked to Software Design and Software Figure 3.1 gives a graphical representation of the
Testing because the software construction process top-level decomposition of the breakdown for the
involves significant software design and testing. Software Construction KA.
The process uses the design output and provides an
input to testing (“design” and “testing” in this case 1. Software Construction Fundamentals
referring to the activities, not the KAs). Boundar-
ies between design, construction, and testing (if Software construction fundamentals include
any) will vary depending on the software life cycle
processes that are used in a project. • minimizing complexity
Although some detailed design may be per- • anticipating change
formed prior to construction, much design work • constructing for verification
is performed during the construction activity. • reuse
Thus, the Software Construction KA is closely • standards in construction.
linked to the Software Design KA.
Throughout construction, software engineers The first four concepts apply to design as well
both unit test and integration test their work. as to construction. The following sections define

3-1
3-2 SWEBOK® Guide V3.0

Figure 3.1. Breakdown of Topics for the Software Construction KA


Software Construction 3-3

these concepts and describe how they apply to independent testing and operational activities.
construction. Specific techniques that support constructing for
verification include following coding standards to
1.1. Minimizing Complexity support code reviews and unit testing, organizing
[1*] code to support automated testing, and restrict-
ing the use of complex or hard-to-understand lan-
Most people are limited in their ability to hold guage structures, among others.
complex structures and information in their
working memories, especially over long peri- 1.4. Reuse
ods of time. This proves to be a major factor [2*]
influencing how people convey intent to com-
puters and leads to one of the strongest drives Reuse refers to using existing assets in solving
in software construction: minimizing complex- different problems. In software construction, typ-
ity. The need to reduce complexity applies to ical assets that are reused include libraries, mod-
essentially every aspect of software construction ules, components, source code, and commercial
and is particularly critical to testing of software off-the-shelf (COTS) assets. Reuse is best prac-
constructions. ticed systematically, according to a well-defined,
In software construction, reduced complexity repeatable process. Systematic reuse can enable
is achieved through emphasizing code creation significant software productivity, quality, and
that is simple and readable rather than clever. It cost improvements.
is accomplished through making use of standards Reuse has two closely related facets: “construc-
(see section 1.5, Standards in Construction), tion for reuse” and “construction with reuse.” The
modular design (see section 3.1, Construction former means to create reusable software assets,
Design), and numerous other specific techniques while the latter means to reuse software assets in
(see section 3.3, Coding). It is also supported by the construction of a new solution. Reuse often
construction-focused quality techniques (see sec- transcends the boundary of projects, which means
tion 3.7, Construction Quality). reused assets can be constructed in other projects
or organizations.
1.2. Anticipating Change
[1*] 1.5. Standards in Construction
[1*]
Most software will change over time, and the
anticipation of change drives many aspects of Applying external or internal development stan-
software construction; changes in the environ- dards during construction helps achieve a proj-
ments in which software operates also affect soft- ect’s objectives for efficiency, quality, and cost.
ware in diverse ways. Specifically, the choices of allowable program-
Anticipating change helps software engineers ming language subsets and usage standards are
build extensible software, which means they can important aids in achieving higher security.
enhance a software product without disrupting Standards that directly affect construction
the underlying structure. issues include
Anticipating change is supported by many spe-
cific techniques (see section 3.3, Coding). • communication methods (for example, stan-
dards for document formats and contents)
1.3. Constructing for Verification • programming languages (for example, lan-
[1*] guage standards for languages like Java and
C++)
Constructing for verification means building • coding standards (for example, standards for
software in such a way that faults can be read- naming conventions, layout, and indentation)
ily found by the software engineers writing the • platforms (for example, interface standards
software as well as by the testers and users during for operating system calls)
3-4 SWEBOK® Guide V3.0

• tools (for example, diagrammatic standards the Software Management and Software Process
for notations like UML (Unified Modeling KAs).
Language)). Consequently, what is considered to be “con-
struction” depends to some degree on the life
Use of external standards. Construction cycle model used. In general, software con-
depends on the use of external standards for con- struction is mostly coding and debugging, but
struction languages, construction tools, technical it also involves construction planning, detailed
interfaces, and interactions between the Software design, unit testing, integration testing, and other
Construction KA and other KAs. Standards come activities.
from numerous sources, including hardware and
software interface specifications (such as the 2.2. Construction Planning
Object Management Group (OMG)) and interna- [1*]
tional organizations (such as the IEEE or ISO).
Use of internal standards. Standards may also The choice of construction method is a key aspect
be created on an organizational basis at the cor- of the construction-planning activity. The choice
porate level or for use on specific projects. These of construction method affects the extent to
standards support coordination of group activi- which construction prerequisites are performed,
ties, minimizing complexity, anticipating change, the order in which they are performed, and the
and constructing for verification. degree to which they should be completed before
construction work begins.
2. Managing Construction The approach to construction affects the proj-
ect team’s ability to reduce complexity, anticipate
2.1. Construction in Life Cycle Models change, and construct for verification. Each of
[1*] these objectives may also be addressed at the pro-
cess, requirements, and design levels—but they
Numerous models have been created to develop will be influenced by the choice of construction
software; some emphasize construction more method.
than others. Construction planning also defines the order
Some models are more linear from the con- in which components are created and integrated,
struction point of view—such as the waterfall and the integration strategy (for example, phased or
staged-delivery life cycle models. These models incremental integration), the software quality
treat construction as an activity that occurs only management processes, the allocation of task
after significant prerequisite work has been com- assignments to specific software engineers, and
pleted—including detailed requirements work, other tasks, according to the chosen method.
extensive design work, and detailed planning.
The more linear approaches tend to emphasize 2.3. Construction Measurement
the activities that precede construction (require- [1*]
ments and design) and to create more distinct sep-
arations between activities. In these models, the Numerous construction activities and artifacts can
main emphasis of construction may be coding. be measured—including code developed, code
Other models are more iterative—such as modified, code reused, code destroyed, code com-
evolutionary prototyping and agile develop- plexity, code inspection statistics, fault-fix and
ment. These approaches tend to treat construc- fault-find rates, effort, and scheduling. These mea-
tion as an activity that occurs concurrently with surements can be useful for purposes of managing
other software development activities (including construction, ensuring quality during construction,
requirements, design, and planning) or that over- and improving the construction process, among
laps them. These approaches tend to mix design, other uses (see the Software Engineering Process
coding, and testing activities, and they often treat KA for more on measurement).
the combination of activities as construction (see
Software Construction 3-5

3. Practical Considerations installations. The text-based configuration files


used in both the Windows and Unix operating
Construction is an activity in which the software systems are examples of this, and the menu-style
engineer has to deal with sometimes chaotic and selection lists of some program generators consti-
changing real-world constraints, and he or she tute another example of a configuration language.
must do so precisely. Due to the influence of real- Toolkit languages are used to build applica-
world constraints, construction is more driven by tions out of elements in toolkits (integrated sets
practical considerations than some other KAs, of application-specific reusable parts); they are
and software engineering is perhaps most craft- more complex than configuration languages.
like in the construction activities. Toolkit languages may be explicitly defined as
application programming languages, or the appli-
3.1. Construction Design cations may simply be implied by a toolkit’s set
[1*] of interfaces.
Scripting languages are commonly used kinds
Some projects allocate considerable design activ- of application programming languages. In some
ity to construction, while others allocate design scripting languages, scripts are called batch files
to a phase explicitly focused on design. Regard- or macros.
less of the exact allocation, some detailed design Programming languages are the most flexible
work will occur at the construction level, and that type of construction languages. They also contain
design work tends to be dictated by constraints the least amount of information about specific
imposed by the real-world problem that is being application areas and development processes—
addressed by the software. therefore, they require the most training and skill
Just as construction workers building a physi- to use effectively. The choice of programming lan-
cal structure must make small-scale modifica- guage can have a large effect on the likelihood of
tions to account for unanticipated gaps in the vulnerabilities being introduced during coding—
builder’s plans, software construction workers for example, uncritical usage of C and C++ are
must make modifications on a smaller or larger questionable choices from a security viewpoint.
scale to flesh out details of the software design There are three general kinds of notation used
during construction. for programming languages, namely
The details of the design activity at the construc-
tion level are essentially the same as described in • linguistic (e.g., C/C++, Java)
the Software Design KA, but they are applied on • formal (e.g., Event-B)
a smaller scale of algorithms, data structures, and • visual (e.g., MatLab).
interfaces.
Linguistic notations are distinguished in par-
3.2. Construction Languages ticular by the use of textual strings to represent
[1*] complex software constructions. The combina-
Construction languages include all forms of tion of textual strings into patterns may have a
communication by which a human can specify an sentence-like syntax. Properly used, each such
executable problem solution to a problem. Con- string should have a strong semantic connotation
struction languages and their implementations providing an immediate intuitive understanding
(for example, compilers) can affect software of what will happen when the software construc-
quality attributes of performance, reliability, por- tion is executed.
tability, and so forth. They can be serious con- Formal notations rely less on intuitive, every-
tributors to security vulnerabilities. day meanings of words and text strings and more
The simplest type of construction language on definitions backed up by precise, unambigu-
is a configuration language, in which software ous, and formal (or mathematical) definitions.
engineers choose from a limited set of pre- Formal construction notations and formal meth-
defined options to create new or custom software ods are at the semantic base of most forms of
3-6 SWEBOK® Guide V3.0

system programming notations, where accuracy, 3.4. Construction Testing


time behavior, and testability are more important [1*]
than ease of mapping into natural language. For-
mal constructions also use precisely defined ways Construction involves two forms of testing,
of combining symbols that avoid the ambiguity which are often performed by the software engi-
of many natural language constructions. neer who wrote the code:
Visual notations rely much less on the textual
notations of linguistic and formal construction • Unit testing
and instead rely on direct visual interpretation • Integration testing.
and placement of visual entities that represent the
underlying software. Visual construction tends to The purpose of construction testing is to reduce
be somewhat limited by the difficulty of making the gap between the time when faults are inserted
“complex” statements using only the arrange- into the code and the time when those faults are
ment of icons on a display. However, these icons detected, thereby reducing the cost incurred to
can be powerful tools in cases where the primary fix them. In some instances, test cases are writ-
programming task is simply to build and “adjust” ten after code has been written. In other instances,
a visual interface to a program, the detailed test cases may be created before code is written.
behavior of which has an underlying definition. Construction testing typically involves a
subset of the various types of testing, which
3.3. Coding are described in the Software Testing KA. For
[1*] instance, construction testing does not typically
include system testing, alpha testing, beta testing,
The following considerations apply to the soft- stress testing, configuration testing, usability test-
ware construction coding activity: ing, or other more specialized kinds of testing.
Two standards have been published on the topic
• Techniques for creating understandable of construction testing: IEEE Standard 829-1998,
source code, including naming conventions IEEE Standard for Software Test Documentation,
and source code layout; and IEEE Standard 1008-1987, IEEE Standard
• Use of classes, enumerated types, variables, for Software Unit Testing.
named constants, and other similar entities; (See sections 2.1.1., Unit Testing, and 2.1.2.,
• Use of control structures; Integration Testing, in the Software Testing KA
• Handling of error conditions—both antici- for more specialized reference material.)
pated and exceptional (input of bad data, for
example); 3.5. Construction for Reuse
• Prevention of code-level security breaches [2*]
(buffer overflows or array index bounds, for
example); Construction for reuse creates software that has
• Resource usage via use of exclusion mecha- the potential to be reused in the future for the
nisms and discipline in accessing serially present project or other projects taking a broad-
reusable resources (including threads and based, multisystem perspective. Construction for
database locks); reuse is usually based on variability analysis and
• Source code organization (into state- design. To avoid the problem of code clones, it
ments, routines, classes, packages, or other is desired to encapsulate reusable code fragments
structures); into well-structured libraries or components.
• Code documentation; The tasks related to software construction for
• Code tuning, reuse during coding and testing are as follows:
Software Construction 3-7

• Variability implementation with mecha- • unit testing and integration testing (see sec-
nisms such as parameterization, conditional tion 3.4, Construction Testing)
compilation, design patterns, and so forth. • test-first development (see section 2.2 in the
• Variability encapsulation to make the soft- Software Testing KA)
ware assets easy to configure and customize. • use of assertions and defensive programming
• Testing the variability provided by the reus- • debugging
able software assets. • inspections
• Description and publication of reusable soft- • technical reviews, including security-ori-
ware assets. ented reviews (see section 2.3.2 in the Soft-
ware Quality KA)
3.6. Construction with Reuse • static analysis (see section 2.3 of the Soft-
[2*] ware Quality KA)

Construction with reuse means to create new The specific technique or techniques selected
software with the reuse of existing software depend on the nature of the software being con-
assets. The most popular method of reuse is to structed as well as on the skillset of the software
reuse code from the libraries provided by the lan- engineers performing the construction activi-
guage, platform, tools being used, or an organiza- ties. Programmers should know good practices
tional repository. Asides from these, the applica- and common vulnerabilities—for example, from
tions developed today widely make use of many widely recognized lists about common vulner-
open-source libraries. Reused and off-the-shelf abilities. Automated static analysis of code for
software often have the same—or better—quality security weaknesses is available for several com-
requirements as newly developed software (for mon programming languages and can be used in
example, security level). security-critical projects.
The tasks related to software construction with Construction quality activities are differenti-
reuse during coding and testing are as follows: ated from other quality activities by their focus.
Construction quality activities focus on code and
• The selection of the reusable units, data- artifacts that are closely related to code—such
bases, test procedures, or test data. as detailed design—as opposed to other artifacts
• The evaluation of code or test reusability. that are less directly connected to the code, such
• The integration of reusable software assets as requirements, high-level designs, and plans.
into the current software.
• The reporting of reuse information on new 3.8. Integration
code, test procedures, or test data. [1*]

3.7. Construction Quality A key activity during construction is the integra-


[1*] tion of individually constructed routines, classes,
components, and subsystems into a single sys-
In addition to faults resulting from requirements tem. In addition, a particular software system
and design, faults introduced during construction may need to be integrated with other software or
can result in serious quality problems—for exam- hardware systems.
ple, security vulnerabilities. This includes not Concerns related to construction integration
only faults in security functionality but also faults include planning the sequence in which compo-
elsewhere that allow bypassing of this functional- nents will be integrated, identifying what hard-
ity and other security weaknesses or violations. ware is needed, creating scaffolding to support
Numerous techniques exist to ensure the qual- interim versions of the software, determining
ity of code as it is constructed. The primary tech- the degree of testing and quality work performed
niques used for construction quality include on components before they are integrated, and
3-8 SWEBOK® Guide V3.0

determining points in the project at which interim 4.2. Object-Oriented Runtime Issues
versions of the software are tested. [1*]
Programs can be integrated by means of either
the phased or the incremental approach. Phased Object-oriented languages support a series of
integration, also called “big bang” integration, runtime mechanisms including polymorphism
entails delaying the integration of component and reflection. These runtime mechanisms
software parts until all parts intended for release increase the flexibility and adaptability of object-
in a version are complete. Incremental integration oriented programs. Polymorphism is the ability
is thought to offer many advantages over the tra- of a language to support general operations with-
ditional phased integration—for example, easier out knowing until runtime what kind of concrete
error location, improved progress monitoring, objects the software will include. Because the
earlier product delivery, and improved customer program does not know the exact types of the
relations. In incremental integration, the develop- objects in advance, the exact behaviour is deter-
ers write and test a program in small pieces and mined at runtime (called dynamic binding).
then combine the pieces one at a time. Additional Reflection is the ability of a program to observe
test infrastructure, such as stubs, drivers, and and modify its own structure and behavior at run-
mock objects, are usually needed to enable incre- time. Reflection allows inspection of classes,
mental integration. By building and integrating interfaces, fields, and methods at runtime with-
one unit at a time (for example, a class or compo- out knowing their names at compile time. It also
nent), the construction process can provide early allows instantiation at runtime of new objects and
feedback to developers and customers. Other invocation of methods using parameterized class
advantages of incremental integration include and method names.
easier error location, improved progress monitor-
ing, more fully tested units, and so forth. 4.3. Parameterization and Generics
[4*]
4. Construction Technologies
Parameterized types, also known as generics
4.1. API Design and Use (Ada, Eiffel) and templates (C++), enable the
[3*] definition of a type or class without specifying all
the other types it uses. The unspecified types are
An application programming interface (API) is the supplied as parameters at the point of use. Param-
set of signatures that are exported and available to eterized types provide a third way (in addition to
the users of a library or a framework to write their class inheritance and object composition) to com-
applications. Besides signatures, an API should pose behaviors in object-oriented software.
always include statements about the program’s
effects and/or behaviors (i.e., its semantics). 4.4. Assertions, Design by Contract, and Defensive
API design should try to make the API easy Programming
to learn and memorize, lead to readable code, be [1*]
hard to misuse, be easy to extend, be complete,
and maintain backward compatibility. As the An assertion is an executable predicate that’s
APIs usually outlast their implementations for placed in a program—usually a routine or macro—
a widely used library or framework, it is desired that allows runtime checks of the program. Asser-
that the API be straightforward and kept stable to tions are especially useful in high-reliability pro-
facilitate the development and maintenance of the grams. They enable programmers to more quickly
client applications. flush out mismatched interface assumptions, errors
API use involves the processes of select- that creep in when code is modified, and so on.
ing, learning, testing, integrating, and possibly Assertions are normally compiled into the code at
extending APIs provided by a library or frame- development time and are later compiled out of the
work (see section 3.6, Construction with Reuse). code so that they don’t degrade the performance.
Software Construction 3-9

Design by contract is a development approach or containing their effects if recovery is not pos-
in which preconditions and postconditions are sible. The most common fault tolerance strategies
included for each routine. When preconditions include backing up and retrying, using auxiliary
and postconditions are used, each routine or code, using voting algorithms, and replacing an
class is said to form a contract with the rest of erroneous value with a phony value that will have
the program. Furthermore, a contract provides a a benign effect.
precise specification of the semantics of a routine,
and thus helps the understanding of its behavior. 4.6. Executable Models
Design by contract is thought to improve the [5*]
quality of software construction.
Defensive programming means to protect a Executable models abstract away the details of
routine from being broken by invalid inputs. specific programming languages and decisions
Common ways to handle invalid inputs include about the organization of the software. Different
checking the values of all the input parameters from traditional software models, a specification
and deciding how to handle bad inputs. Asser- built in an executable modeling language like
tions are often used in defensive programming to xUML (executable UML) can be deployed in
check input values. various software environments without change.
An executable-model compiler (transformer) can
4.5. Error Handling, Exception Handling, and turn an executable model into an implementation
Fault Tolerance using a set of decisions about the target hardware
[1*] and software environment. Thus, constructing
executable models can be regarded as a way of
The way that errors are handled affects software’s constructing executable software.
ability to meet requirements related to correct- Executable models are one foundation support-
ness, robustness, and other nonfunctional attri- ing the Model-Driven Architecture (MDA) initia-
butes. Assertions are sometimes used to check tive of the Object Management Group (OMG). An
for errors. Other error handling techniques—such executable model is a way to completely specify
as returning a neutral value, substituting the next a Platform Independent Model (PIM); a PIM is
piece of valid data, logging a warning message, a model of a solution to a problem that does not
returning an error code, or shutting down the soft- rely on any implementation technologies. Then
ware—are also used. a Platform Specific Model (PSM), which is a
Exceptions are used to detect and process model that contains the details of the implemen-
errors or exceptional events. The basic structure tation, can be produced by weaving together the
of an exception is that a routine uses throw to PIM and the platform on which it relies.
throw a detected exception and an exception han-
dling block will catch the exception in a try-catch 4.7. State-Based and Table-Driven Construction
block. The try-catch block may process the erro- Techniques
neous condition in the routine or it may return [1*]
control to the calling routine. Exception handling
policies should be carefully designed follow- State-based programming, or automata-based
ing common principles such as including in the programming, is a programming technology
exception message all information that led to the using finite state machines to describe program
exception, avoiding empty catch blocks, knowing behaviours. The transition graphs of a state
the exceptions the library code throws, perhaps machine are used in all stages of software devel-
building a centralized exception reporter, and opment (specification, implementation, debug-
standardizing the program’s use of exceptions. ging, and documentation). The main idea is to
Fault tolerance is a collection of techniques construct computer programs the same way the
that increase software reliability by detecting automation of technological processes is done.
errors and then recovering from them if possible State-based programming is usually combined
3-10 SWEBOK® Guide V3.0

with object-oriented programming, forming a programmer-defined variables that populate the


new composite approach called state-based, tree. After building the parse tree, the program
object-oriented programming. uses it as input to the computational processes.
A table-driven method is a schema that uses
tables to look up information rather than using 4.10. Concurrency Primitives
logic statements (such as if and case). Used in [7*]
appropriate circumstances, table-driven code
is simpler than complicated logic and easier to A synchronization primitive is a programming
modify. When using table-driven methods, the abstraction provided by a programming language
programmer addresses two issues: what informa- or the operating system that facilitates concur-
tion to store in the table or tables, and how to effi- rency and synchronization. Well-known concur-
ciently access information in the table. rency primitives include semaphores, monitors,
and mutexes.
4.8. Runtime Configuration and A semaphore is a protected variable or abstract
Internationalization data type that provides a simple but useful abstrac-
[1*] tion for controlling access to a common resource
by multiple processes or threads in a concurrent
To achieve more flexibility, a program is often programming environment.
constructed to support late binding time of its vari- A monitor is an abstract data type that presents
ables. Runtime configuration is a technique that a set of programmer-defined operations that are
binds variable values and program settings when executed with mutual exclusion. A monitor con-
the program is running, usually by updating and tains the declaration of shared variables and pro-
reading configuration files in a just-in-time mode. cedures or functions that operate on those vari-
Internationalization is the technical activ- ables. The monitor construct ensures that only
ity of preparing a program, usually interactive one process at a time is active within the monitor.
software, to support multiple locales. The corre- A mutex (mutual exclusion) is a synchroniza-
sponding activity, localization, is the activity of tion primitive that grants exclusive access to a
modifying a program to support a specific local shared resource by only one process or thread at
language. Interactive software may contain doz- a time.
ens or hundreds of prompts, status displays, help
messages, error messages, and so on. The design 4.11. Middleware
and construction processes should accommodate [3*] [6*]
string and character-set issues including which
character set is to be used, what kinds of strings Middleware is a broad classification for soft-
are used, how to maintain the strings without ware that provides services above the operating
changing the code, and translating the strings into system layer yet below the application program
different languages with minimal impact on the layer. Middleware can provide runtime contain-
processing code and the user interface. ers for software components to provide message
passing, persistence, and a transparent location
4.9. Grammar-Based Input Processing across a network. Middleware can be viewed as
[1*] [6*] a connector between the components that use the
middleware. Modern message-oriented middle-
Grammar-based input processing involves syntax ware usually provides an Enterprise Service Bus
analysis, or parsing, of the input token stream. It (ESB), which supports service-oriented interac-
involves the creation of a data structure (called a tion and communication between multiple soft-
parse tree or syntax tree) representing the input ware applications.
data. The inorder traversal of the parse tree usu-
ally gives the expression just parsed. The parser
checks the symbol table for the presence of
Software Construction 3-11

4.12. Construction Methods for Distributed algorithm selection—influences an execution


Software speed and size. Performance analysis is the inves-
[7*] tigation of a program’s behavior using informa-
tion gathered as the program executes, with the
A distributed system is a collection of physically goal of identifying possible hot spots in the pro-
separate, possibly heterogeneous computer sys- gram to be improved.
tems that are networked to provide the users with Code tuning, which improves performance at
access to the various resources that the system the code level, is the practice of modifying correct
maintains. Construction of distributed software is code in ways that make it run more efficiently.
distinguished from traditional software construc- Code tuning usually involves only small-scale
tion by issues such as parallelism, communica- changes that affect a single class, a single routine,
tion, and fault tolerance. or, more commonly, a few lines of code. A rich
Distributed programming typically falls into one set of code tuning techniques is available, includ-
of several basic architectural categories: client- ing those for tuning logic expressions, loops, data
server, 3-tier architecture, n-tier architecture, dis- transformations, expressions, and routines. Using
tributed objects, loose coupling, or tight coupling a low-level language is another common tech-
(see section 14.3 of the Computing Foundations nique for improving some hot spots in a program.
KA and section 3.2 of the Software Design KA).
4.15. Platform Standards
4.13. Constructing Heterogeneous Systems [6*] [7*]
[6*]
Platform standards enable programmers to
Heterogeneous systems consist of a variety of develop portable applications that can be exe-
specialized computational units of different types, cuted in compatible environments without
such as Digital Signal Processors (DSPs), micro- changes. Platform standards usually involve a
controllers, and peripheral processors. These set of standard services and APIs that compat-
computational units are independently controlled ible platform implementations must implement.
and communicate with one another. Embedded Typical examples of platform standards are Java
systems are typically heterogeneous systems. 2 Platform Enterprise Edition (J2EE) and the
The design of heterogeneous systems may POSIX standard for operating systems (Portable
require the combination of several specification Operating System Interface), which represents
languages in order to design different parts of a set of standards implemented primarily for
the system—in other words, hardware/software UNIX-based operating systems.
codesign. The key issues include multilanguage
validation, cosimulation, and interfacing. 4.16. Test-First Programming
During the hardware/software codesign, soft- [1*]
ware development and virtual hardware devel-
opment proceed concurrently through stepwise Test-first programming (also known as Test-
decomposition. The hardware part is usually Driven Development—TDD) is a popular devel-
simulated in field programmable gate arrays opment style in which test cases are written prior
(FPGAs) or application-specific integrated cir- to writing any code. Test-first programming can
cuits (ASICs). The software part is translated into usually detect defects earlier and correct them
a low-level programming language. more easily than traditional programming styles.
Furthermore, writing test cases first forces pro-
4.14. Performance Analysis and Tuning grammers to think about requirements and design
[1*] before coding, thus exposing requirements and
design problems sooner.
Code efficiency—determined by architecture,
detailed design decisions, and data-structure and
3-12 SWEBOK® Guide V3.0

5. Software Construction Tools 5.3. Unit Testing Tools


[1*] [2*]
5.1. Development Environments Unit testing verifies the functioning of software
[1*] modules in isolation from other software elements
that are separately testable (for example, classes,
A development environment, or integrated devel- routines, components). Unit testing is often auto-
opment environment (IDE), provides compre- mated. Developers can use unit testing tools
hensive facilities to programmers for software and frameworks to extend and create automated
construction by integrating a set of development testing environment. With unit testing tools and
tools. The choices of development environments frameworks, the developer can code criteria into
can affect the efficiency and quality of software the test to verify the unit’s correctness under vari-
construction. ous data sets. Each individual test is implemented
In additional to basic code editing functions, as an object, and a test runner runs all of the tests.
modern IDEs often offer other features like com- During the test execution, those failed test cases
pilation and error detection from within the edi- will be automatically flagged and reported.
tor, integration with source code control, build/
test/debugging tools, compressed or outline 5.4. Profiling, Performance Analysis, and
views of programs, automated code transforms, Slicing Tools
and support for refactoring. [1*]

5.2. GUI Builders Performance analysis tools are usually used to


[1*] support code tuning. The most common per-
formance analysis tools are profiling tools. An
A GUI (Graphical User Interface) builder is a execution profiling tool monitors the code while
software development tool that enables the devel- it runs and records how many times each state-
oper to create and maintain GUIs in a WYSI- ment is executed or how much time the program
WYG (what you see is what you get) mode. A spends on each statement or execution path. Pro-
GUI builder usually includes a visual editor filing the code while it is running gives insight
for the developer to design forms and windows into how the program works, where the hot spots
and manage the layout of the widgets by drag- are, and where the developers should focus the
ging, dropping, and parameter setting. Some GUI code tuning efforts.
builders can automatically generate the source Program slicing involves computation of the
code corresponding to the visual GUI design. set of program statements (i.e., the program slice)
Because current GUI applications usually fol- that may affect the values of specified variables
low the event-driven style (in which the flow of at some point of interest, which is referred to as
the program is determined by events and event a slicing criterion. Program slicing can be used
handling), GUI builder tools usually provide for locating the source of errors, program under-
code generation assistants, which automate the standing, and optimization analysis. Program
most repetitive tasks required for event handling. slicing tools compute program slices for various
The supporting code connects widgets with the programming languages using static or dynamic
outgoing and incoming events that trigger the analysis methods.
functions providing the application logic.
Some modern IDEs provide integrated GUI
builders or GUI builder plug-ins. There are also
many standalone GUI builders.
Software Construction 3-13

MATRIX OF TOPICS VS. REFERENCE MATERIAL

Mellor and Balcer 2002

Silberschatz et al. 2008


Null and Lobur 2006
Clements et al. 2010

Gamma et al. 1994


Sommerville 2011
McConnell 2004

[7*]
[5*]
[3*]
[2*]

[4*]

[6*]
[1*]

1. Software
Construction
Fundamentals
c2, c3,
c7-c9,
1.1. Minimizing
c24, c27,
Complexity
c28, c31,
c32, c34
c3–c5,
1.2. Anticipating
c24, c31,
Change
c32, c34
c8,
1.3. Constructing for c20–
Verification c23, c31,
c34
1.4. Reuse c16
1.5. Standards in
c4
Construction
2. Managing
Construction
2.1. Construction in c2, c3,
Life Cycle Models c27, c29
c3, c4,
2.2. Construction
c21,
Planning
c27–c29
2.3. Construction
c25, c28
Measurement
3. Practical
Considerations
3.1. Construction c3, c5,
Design c24
3.2. Construction
c4
Languages
c5–c19,
3.3. Coding
c25–c26
3-14 SWEBOK® Guide V3.0

Mellor and Balcer 2002

Silberschatz et al. 2008


Null and Lobur 2006
Clements et al. 2010

Gamma et al. 1994


Sommerville 2011
McConnell 2004

[7*]
[5*]
[3*]
[2*]

[4*]

[6*]
[1*]

3.4. Construction
c22, c23
Testing
3.5. Construction for
c16
Reuse
3.6. Construction
c16
with Reuse
3.7. Construction c8,
Quality c20–c25
3.8. Integration c29
4. Construction
Technologies
4.1. API Design and
c7
Use
4.2. Object-Oriented
c6, c7
Runtime Issues
4.3.
Parameterization c1
and Generics
4.4. Assertions,
Design by Contract,
c8, c9
and Defensive
Programming
4.5. Error Handling,
Exception Handling, c3, c8
and Fault Tolerance
4.6. Executable
c1
Models
4.7. State-Based
and Table-Driven
c18
Construction
Techniques
4.8. Runtime
Configuration and c3, c10
Internationalization
4.9. Grammar-Based
c5 c8
Input Processing
Software Construction 3-15

Mellor and Balcer 2002

Silberschatz et al. 2008


Null and Lobur 2006
Clements et al. 2010

Gamma et al. 1994


Sommerville 2011
McConnell 2004

[7*]
[5*]
[3*]
[2*]

[4*]

[6*]
4.10. Concurrency [1*]
c6
Primitives
4.11. Middleware c1 c8
4.12. Construction
Methods for c2
Distributed Software
4.13. Constructing
Heterogeneous c9
Systems
4.14. Performance
c25, c26
Analysis and Tuning
4.15. Platform
c10 c1
Standards
4.16. Test-First
c22
Programming
5. Construction Tools
5.1. Development
c30
Environments
5.2. GUI Builders c30
5.3. Unit Testing
c22 c8
Tools
5.4. Profiling,
Performance
c25, c26
Analysis, and
Slicing Tools
3-16 SWEBOK® Guide V3.0

FURTHER READINGS REFERENCES

IEEE Std. 1517-2010 Standard for Information [1*] S. McConnell, Code Complete, 2nd ed.,
Technology—System and Software Life Microsoft Press, 2004.
Cycle Processes—Reuse Processes, IEEE,
2010 [8]. [2*] I. Sommerville, Software Engineering, 9th
ed., Addison-Wesley, 2011.
This standard specifies the processes, activities,
and tasks to be applied during each phase of the [3*] P. Clements et al., Documenting Software
software life cycle to enable a software product Architectures: Views and Beyond, 2nd ed.,
to be constructed from reusable assets. It covers Pearson Education, 2010.
the concept of reuse-based development and the
processes of construction for reuse and construc- [4*] E. Gamma et al., Design Patterns: Elements
tion with reuse. of Reusable Object-Oriented Software, 1st
ed., Addison-Wesley Professional, 1994.
IEEE Std. 12207-2008 (a.k.a. ISO/IEC
12207:2008) Standard for Systems and [5*] S.J. Mellor and M.J. Balcer, Executable
Software Engineering—Software Life Cycle UML: A Foundation for Model-Driven
Processes, IEEE, 2008 [9]. Architecture, 1st ed., Addison-Wesley,
2002.
This standard defines a series of software devel-
opment processes, including software construc- [6*] L. Null and J. Lobur, The Essentials of
tion process, software integration process, and Computer Organization and Architecture,
software reuse process. 2nd ed., Jones and Bartlett Publishers,
2006.

[7*] A. Silberschatz, P.B. Galvin, and G. Gagne,


Operating System Concepts, 8th ed., Wiley,
2008.

[8] IEEE Std. 1517-2010 Standard for


Information Technology—System and
Software Life Cycle Processes—Reuse
Processes, IEEE, 2010.

[9] IEEE Std. 12207-2008 (a.k.a. ISO/IEC


12207:2008) Standard for Systems and
Software Engineering—Software Life Cycle
Processes, IEEE, 2008.

You might also like