-
Notifications
You must be signed in to change notification settings - Fork 0
/
software_engineering.lyx
1661 lines (1331 loc) · 37.3 KB
/
software_engineering.lyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 1in
\bottommargin 1in
\secnumdepth 3
\tocdepth 1
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Software Engineering
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\series bold
Disclaimer
\series default
: These notes have been prepared with the
\series bold
only
\series default
purpose to help me pass the Computer Science qualifiying exam at the University
of Illinois at Chicago.
They are distributed as they are (including errors, typos, omissions, etc.)
to help other students pass this exam (and possibly relieving them from
part of the pain associated with such a process).
I take
\series bold
no responsibility
\series default
for the material contained in these notes (which means that you can't sue
me if you don't pass the qual!) Moreover, this pdf version is distributed
together with the original LaTeX (and LyX) sources hoping that someone
else will improve and correct them.
I mean in absolute no way to violate copyrights and/or take credit stealing
the work of others.
The ideas contained in these pages are
\series bold
not mine
\series default
but I've just aggregated information scattered all over the internet.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareA
like 3.0 Unported License.
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\end_layout
\begin_layout Section
Software lifecycles (academic)
\end_layout
\begin_layout Subsection
Software release lifecycle
\end_layout
\begin_layout Standard
The software release life cycle is composed of discrete phases that describe
the software's maturity as it advances from planning and development to
release and support phases.
\end_layout
\begin_layout Description
Pre-alpha: refers to all activities performed during the software project
prior to system testing.
These activities can include requirements analysis, software design, software
development and unit testing.There are several types of pre-alpha versions:
development releases, nightly builds, milestones, etc.
\end_layout
\begin_layout Description
Alpha: in this phase, developers generally test the software using white
box techniques.
Additional validation is then performed using black box or gray box techniques,
by another testing team.
Moving to black box testing inside the organization is known as alpha release.
Alpha software can be unstable and could cause crashes or data loss.
The alpha phase usually ends with a
\emph on
feature freeze
\emph default
, indicating that no more features will be added to the software.
At this time, the software is said to be feature complete.
\end_layout
\begin_layout Description
Beta: in this phase, pilot testing is performed by a limited number of end
users in the target environment.
The users of a beta version are called beta testers.
They are usually customers or prospective customers of the organization
that develops the software, willing to test the software for free or for
a reduced price.
\end_layout
\begin_layout Description
Release
\begin_inset space ~
\end_inset
Candidate: The term release candidate (RC) refers to a version with potential
to be a final product, ready to release unless fatal bugs emerge.
In this stage of product stabilization, all product features have been
designed, coded and tested through one or more beta cycles with no known
showstopper-class bug.
\end_layout
\begin_layout Description
RTM: The term "release to manufacturing" or "release to marketing" (both
abbreviated RTM), also known as "gold", is a term used to indicate that
the software has reached a point that it is ready to or has been delivered
or provided to the customer.
RTM happens prior to general availability (GA) when the product is released
to the public.
\end_layout
\begin_layout Description
GA: General Availability or General Acceptance (both abbreviated GA) is
the point where all necessary commercialization activities have been completed
and the software has been made available to the general market
\end_layout
\begin_layout Subsection
Development lifecycles
\end_layout
\begin_layout Itemize
Waterfall model: it's an activity-centered life cycle that prescribes sequential
executions of subsets of the development processes and management processes
\end_layout
\begin_layout Itemize
v-Model: it's a modification of the waterfall model that makes explicit
the dependency between development activities and verification activities.
\end_layout
\begin_layout Itemize
Spiral model: is an activity-centered life cycle model that was devised
to address the source of weaknesses in the waterfall model, in particular
to accommodate infrequent change during the software development.
This model focuses on addressing risks incrementally, in order of priority.
\end_layout
\begin_layout Itemize
Unified Software Development Process: distinguishes important time ranges
in software development called cycles.
(birth, childhood, adulthood, retirement, death) Each cycle has four phases:
Inception, Elaboration, Construction, Transition.
\end_layout
\begin_layout Itemize
Issue-based model: based on solving issues that are generated progressively.
\end_layout
\begin_layout Itemize
Agile software development: it is a group of software development methodologies
based on iterative and incremental development, where requirements and
solutions evolve through collaboration between self-organizing, cross-functiona
l teams.
e.g.
Scrum
\end_layout
\begin_layout Section
Requirements elicitation
\end_layout
\begin_layout Subsection
Functional Requirements
\end_layout
\begin_layout Standard
Functional requirements describe the behavior and the interactions of the
system with its environment independently of its implementation.
The environment includes the user and any other external system with which
the system interacts.
\end_layout
\begin_layout Subsection
Nonfunctional Requirements
\end_layout
\begin_layout Standard
Nonfictional requirements describe aspects of the system that are not directly
related to the functional behavior.
Nonfictional requirements include a broad variety of requirements that
apply to many different aspects of the system.
Some nonfunctional requirements categories are: usability, reliability,
performance, supportability, constraints (implementation requirements,
legal categories,...).
\end_layout
\begin_layout Subsection
Analysis
\end_layout
\begin_layout Standard
Once the requirement elicitation activity is over the development team focuses
on the analysis phase.
Analysis focuses on producing a model of the system, called
\emph on
analysis model
\emph default
, that is correct, complete, consistent and verifiable.
The two are different since during this phase the developers focus on structuri
ng and formalizing the requirements elicited from users.
Doing so leads to new insight and the discovery of errors in the requirements.
\end_layout
\begin_layout Standard
The analysis model is composed of three parts: the
\emph on
functional model
\emph default
, represented by use cases and scenarios, the
\emph on
analysis object model
\emph default
, represented by class and object diagrams, and the
\emph on
dynamic model
\emph default
, represented by state machine and sequence diagrams.
\end_layout
\begin_layout Subsection
RAD
\end_layout
\begin_layout Standard
The
\emph on
Requirement Analysis Document
\emph default
(
\emph on
RAD
\emph default
) is the result of the requirements elicitation (and analysis) activities.
This document completely describes the system in terms of functional and
nonfunctional requirements.
The first part of the document is written during the requirement elicitation
phase while the second part is completed during the analysis phase.
\end_layout
\begin_layout Section
Design
\end_layout
\begin_layout Subsection
Design principles
\end_layout
\begin_layout Itemize
\emph on
Coupling
\emph default
is the number of dependencies between two subsystems.
If two subsystems are loosely coupled, they are relatively independent,
so modifications to one will have little impact on the other.
If two subsystems are strongly coupled, modifications to one subsystem
is likely to have impact on the other.
\end_layout
\begin_layout Itemize
\emph on
Cohesion
\emph default
is the number of dependencies within a subsystem.
If a subsystem contains many objects that are related to each other and
perform similar task, its cohesion is high.
If a subsystem contains a number of unrelated objects, its cohesion is
low.
\end_layout
\begin_layout Standard
When designing a system a good property is that subsystems are as loosely
coupled as possible (
\emph on
minimize coupling
\emph default
) and as highly cohese as possible (
\emph on
maximize cohesion
\emph default
).
\end_layout
\begin_layout Itemize
\emph on
Layering
\emph default
allows systems to be organized as a hierarchy of subsystems, each providing
higher-level services to the subsystems above it by using lower-level services
from subsystems below it.
\end_layout
\begin_layout Itemize
\emph on
Partitioning
\emph default
organizes subsystems as peers that mutually provide different services
to each other.
\end_layout
\begin_layout Subsubsection
Different purposed for classes and inheritance
\end_layout
\begin_layout Standard
Class hierarchies and polymorphism can be used to model both the application
domain and the solution domain.
\end_layout
\begin_layout Itemize
\emph on
Application objects
\emph default
, also called
\emph on
domain objects
\emph default
, represents concepts of the domain that are relevant to the system.
\end_layout
\begin_layout Itemize
\emph on
Solution objects
\emph default
represent components that do not have a counterpart in the application
domain, such as persistent data stores, user interface objects, or middleware.
\end_layout
\begin_layout Standard
In the same way inheritance can be used both to classify analysis object
into taxonomies or to reduce redundancy and enhance extensibility of the
software product.
\end_layout
\begin_layout Itemize
\emph on
Specification inheritance
\emph default
consists of the classification of concepts into type hierarchies.
\end_layout
\begin_layout Itemize
\emph on
Implementation inheritance
\emph default
, instead, is the use of inheritance for the sole purpose of reusing code.
Usually
\emph on
delegation
\emph default
(i.e.
implementing an operation in a certain class by resending a message to
another class) is a preferable mechanism to achieve reuse.
\end_layout
\begin_layout Subsubsection
Kent Beck's four rules of simple design
\end_layout
\begin_layout Itemize
Runs all the tests.
\end_layout
\begin_layout Itemize
Expresses every idea that we need to express.
(intent)
\end_layout
\begin_layout Itemize
Says everything OnceAndOnlyOnce.
(no duplication)
\end_layout
\begin_layout Itemize
Has no superfluous parts.
(minimize classes/methods)
\end_layout
\begin_layout Subsection
Architectural styles
\end_layout
\begin_layout Description
Model-View-Controller: View renders data, observing Model, and you can have
multiple.
Controller receives user input and makes modifications to Model.
\end_layout
\begin_layout Description
Repository: Independent component interact only through the repository.
\end_layout
\begin_layout Description
Multi-tier
\begin_inset space ~
\end_inset
architecture: Each tier is dedicated to a purpose.
Usually interface, application logic and storage.
\end_layout
\begin_layout Description
Pipes
\begin_inset space ~
\end_inset
and
\begin_inset space ~
\end_inset
filters: Subsystems process data received as inputs and send results to
other subsystems via a set of outputs.
\end_layout
\begin_layout Description
Client-Server: the server provides services to a client which requires them.
\end_layout
\begin_layout Description
Peer-to-peer: generalization of client server where subsystems are both.
\end_layout
\begin_layout Subsection
Design patterns
\end_layout
\begin_layout Standard
In object-oriented development,
\emph on
design patterns
\emph default
are template solutions that developers have refined over time to solve
a range of recurring problems.
\end_layout
\begin_layout Subsubsection
Creational patterns (5)
\end_layout
\begin_layout Standard
These patterns have to do with class instantiation.
They can be further divided into class-creation patterns and object-creational
patterns.
While class-creation patterns use inheritance effectively in the instantiation
process, object-creation patterns use delegation to get the job done.
\end_layout
\begin_layout Itemize
\emph on
Abstract Factory
\emph default
groups object factories that have a common theme.
\end_layout
\begin_layout Itemize
\emph on
Builder
\emph default
constructs complex objects by separating construction and representation.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Factory
\series default
method
\emph default
creates objects without specifying the exact class to create.
\end_layout
\begin_layout Itemize
\emph on
Prototype
\emph default
creates objects by cloning an existing object.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Singleton
\series default
\emph default
restricts object creation for a class to only one instance.
\end_layout
\begin_layout Subsubsection
Structural patterns (7)
\end_layout
\begin_layout Standard
These concern class and object composition.
They use inheritance to compose interfaces and define ways to compose objects
to obtain new functionality.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Adapter
\series default
\emph default
allows classes with incompatible interfaces to work together by wrapping
its own interface around that of an already existing class.
\end_layout
\begin_layout Itemize
\emph on
Bridge
\emph default
decouples an abstraction from its implementation so that the two can vary
independently.
\end_layout
\begin_layout Itemize
\emph on
Composite
\emph default
composes zero-or-more similar objects so that they can be manipulated as
one object.
\end_layout
\begin_layout Itemize
\emph on
Decorator
\emph default
dynamically adds/overrides behaviour in an existing method of an object.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Facade
\series default
\emph default
provides a simplified interface to a large body of code.
\end_layout
\begin_layout Itemize
\emph on
Flyweight
\emph default
reduces the cost of creating and manipulating a large number of similar
objects.
\end_layout
\begin_layout Itemize
\emph on
Proxy
\emph default
provides a placeholder for another object to control access, reduce cost,
and reduce complexity.
\end_layout
\begin_layout Subsubsection
Behavioral patterns (11)
\end_layout
\begin_layout Standard
Most of these design patterns are specifically concerned with communication
between objects.
\end_layout
\begin_layout Itemize
\emph on
Chain of responsibility
\emph default
delegates commands to a chain of processing objects.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Command
\series default
\emph default
creates objects which encapsulate actions and parameters.
\end_layout
\begin_layout Itemize
\emph on
Interpreter
\emph default
implements a specialized language.
\end_layout
\begin_layout Itemize
\series bold
\emph on
Iterator
\series default
\emph default
accesses the elements of an object sequentially without exposing its underlying
representation.
\end_layout
\begin_layout Itemize
\emph on
Mediator
\emph default
allows loose coupling between classes by being the only class that has
detailed knowledge of their methods.
\end_layout
\begin_layout Itemize
\emph on
Memento
\emph default
provides the ability to restore an object to its previous state (undo).
\end_layout
\begin_layout Itemize
\series bold
\emph on
Observer
\series default
\emph default
is a publish/subscribe pattern which allows a number of observer objects
to see an event.
\end_layout
\begin_layout Itemize
\emph on
State
\emph default
allows an object to alter its behavior when its internal state changes.
\end_layout
\begin_layout Itemize
\emph on
Strategy
\emph default
allows one of a family of algorithms to be selected on-the-fly at runtime.
\end_layout
\begin_layout Itemize
\emph on
Template method
\emph default
defines the skeleton of an algorithm as an abstract class, allowing its
subclasses to provide concrete behavior.
\end_layout
\begin_layout Itemize
\emph on
Visitor
\emph default
separates an algorithm from an object structure by moving the hierarchy
of methods into one object.
\end_layout
\begin_layout Section
Object Oriented Design
\end_layout
\begin_layout Itemize
\emph on
Aggregation
\emph default
(vs
\emph on
composition
\emph default
):
\end_layout
\begin_deeper
\begin_layout Itemize
In aggregation, A uses B.
B exists independelty of A.
\end_layout
\begin_layout Itemize
In composition A owns B.
B has no meaninig without A (i.e.
B is a component of A).
\end_layout
\end_deeper
\begin_layout Itemize
\emph on
Class (vs object)
\emph default
: A class is a written piece of code that defines the behavior of a given
class.
An object is an instance of a class obtained through a process of instantiation.
\end_layout
\begin_layout Itemize
\emph on
Class / static initializer
\emph default
: block of code that is used to initialize static members.
Similar to a
\begin_inset Quotes eld
\end_inset
constructor for class/static methods/attributes
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Itemize
\emph on
Class / static method
\emph default
/attribute: methods that don't belong to any object (i.e.
instance) but to the class itself.
\end_layout
\begin_layout Itemize
\emph on
Constructor
\emph default
: block of code that is used to inizialize new objects (i.e.
class instances).
It's executed every time a new instance is created.
\end_layout
\begin_layout Itemize
\emph on
Delegation / forwarding
\emph default
: is a design pattern where an object, instead of performing one of its
stated tasks, delegates that task to an associated helper object.
\end_layout
\begin_layout Itemize
\emph on
Dependency Injection (DI)
\emph default
: A desingn pattern that removes hard-coded dependencies (i.e.
services) from dependent objects (i.e.
clients).
The service is made part of the client's state.
Passing the service to the client, rather than allowing a client to build
or find the service.
There are three main ways of injecting dependencies:
\end_layout
\begin_deeper
\begin_layout Itemize
constructor injection: the dependencies are provided through a class constructor.
\end_layout
\begin_layout Itemize
setter injection: the client exposes a setter method that the injector uses
to inject the dependency.
\end_layout
\begin_layout Itemize
interface injection: the dependency provides an injector method that will
inject the dependency into any client passed to it.
Clients must implement an interface that exposes a setter method that accepts
the dependency.
\end_layout
\end_deeper
\begin_layout Itemize
\emph on
Dependency Inversion
\emph default
\emph on
Principle (DIP)
\emph default
: tells us how to achieve decoupling in software.
The principle states:
\end_layout
\begin_deeper
\begin_layout Itemize
High-level modules (i.e.
Client) should not depend on low-level modules (i.e.
dependencies).
Both should depend on abstractions.
\end_layout
\begin_layout Itemize
Abstractions should not depend on details.
Details should depend on abstractions
\end_layout
\end_deeper
\begin_layout Itemize
\emph on
Destructor / finalizer
\emph default
: a block of code that is executed every time an object is destroyed / deallocat
ed.
\end_layout
\begin_layout Itemize
\emph on
Encapsulation
\emph default
: boundling data and the functions operating on such data for the purpose
of restricting access to some data or code (data hiding)
\end_layout
\begin_layout Itemize
\emph on
Inheritance
\emph default
: A mechanism for code reuse to allow extension of the original software.
Not to be confused with subtyping (Subtyping is described by Is-a relationship,
while inheritance is pure code reuse).
\end_layout
\begin_layout Itemize
\emph on
Instantiation
\emph default
: The process of creating an object from a class.
\end_layout
\begin_layout Itemize
\emph on
Interface / protocol (vs abstract class)
\emph default
: both can't be instantiated but interfaces only specify which methods need
to be implemented without any implementation while abstract classes provide
some implementation and attributes.