Software Development Tools
Revision Control Using GitLab and Git
Introduction to Software Systems 1110/1140/6710
Copyright By PowCoder代写 加微信 powcoder
Integrated Development Environments
• Arichcontextforsoftwaredevelopment
– Examples: Eclipse, IntelliJ, VisualStudio, XCode
• Syntax highlighting, continuous compilation, testing, debugging, packaging
• Powerfulrefactoringcapabilities
Introduction to Software Systems 1110/1140/6710
Revision Control S1
Revision Control
• Indispensiblesoftwareengineeringtool
• Solitary work
– Personal audit trail and time machine
– Establish when bug was introduced
– Fearlessly explore new ideas (roll back if no good)
• Teamwork
– Concurrently develop – Share work coherently
Introduction to Software Systems 1110/1140/6710
• Distributedversioncontrolsystem
– hg, git, others (conceptually very similar)
• Contrastwithcentralizedversioncontrol – cvs, svn, others
We will focus on distributed version control systems and not discuss centralized version control any further.
Introduction to Software Systems 1110/1140/6710
Git & GitLab S1
Git & GitLab
Introduction to Software Systems 1110/1140/6710
IntelliJ Git Integration S1
IntelliJ Git Integration
• Createanewrepository:
– VCS->Import into Version Control->Create Git Repository…
• Cloneanexistingrepository:
– VCS->Checkout from Version Control->Git…
• Other operations: – VCS
– VCS->Git
– right mouse click -> Git
Introduction to Software Systems 1110/1140/6710
Revision Control
Structured Programming 1110/1140/6710
Revision Control S2
Git Concepts
• Commit(noun)
• Staging (IntelliJ allows you to more or less ignore this, so we will)
✔ Commit (atomically commit changes to your local repo)
✔ Push (push outstanding local changes to a remote repo)
✔ Pull (pull new changes from a remote repo)
✔ Update (update your working version)
• Reset and Revert
Structured Programming 1110/1140/6710
Revision Control S2
Git Commits
Captures a set of changes (including modifications, additions and deletions) that may span multiple files.
• Globally unique commit ID (large hexadecimal number)
• Parent–childrelationship(basedonchangesetID)
– Single parent, single child is simple case – Multiple children indicates a branch
– Multiple parents indicates a merge
• A push sends commits, a pull gets commits
• Commits are usually never deleted
Structured Programming 1110/1140/6710
Revision Control S2
A Little More on Update
Update will by default take you to the “HEAD” (the most recent known commit).
You can, however, “update” to any particular revision, moving yourself back and forward in time. To do this, you need to specify the revision.
In IntelliJ you can do this by double-clicking on the revision (VCS -> Git -> Show History, then select the revision)
Structured Programming 1110/1140/6710
Revision Control S2
Branches and Merging
A branch occurs when a commit has more than one child.
A merge is special commit with two parents (thus uniting branches).
If branches are conflicting (changes to the same file), those conflicts must be resolved before merging.
Structured Programming 1110/1140/6710
Revision Control S2
Amend Reset and Revert
You can amend a commit message with amend
You can reset your local state to a particular commit (throwing away
un-pushed changes whether committed or) with reset.
You can also revert any particular commit. This amounts to applying a counteracting commit.
Structured Programming 1110/1140/6710
Revision Control S2
When All Else Fails
Structured Programming 1110/1140/6710
Software Development Teams S3
Structured Programming 1110/1140/6710
Test Driven Development
Test-Driven Development (TDD) JUnit
Structured Programming 1110/1140/6710
TDD and JUnit S4
Test Driven Development (TDD)
TDD “red, green, refactor”
1. Create test that defines new requirements 2. Ensuretestfails
3. Writecodetosupportnewrequirement
4. Run tests to ensure code is correct
5. Then refactor and improve
Key element of agile programming
Structured Programming 1110/1140/6710 6
TDD and JUnit S4
Unit testing for Java
• Developed by
– Father of extreme programming movement
• IntegratedintoIntelliJ
• Useful for:
– TDD (Test driven development)
– Bug isolation and regression testing
• Precisely identify the bug with a unit test
• Use test to ensure that the bug is not reintroduced
Structured Programming 1110/1140/6710 7
TDD and JUnit S4
• Methods marked with @Test will be tested
• When JUnit is called on a class, all tests are run and a report is
generated (a failed test does not stop execution of subsequent tests).
• JUnit has a rich set of annotations that can be used to configure the testing environment, including:
– @Test, @Ignore, @Before, @BeforeClass, @After, @AfterClass
• JUnit can check that an exception is thrown if that is expected in a certain case
– @Test(expected = ArithmeticException)
Structured Programming 1110/1140/6710 8
Software Engineering
What is Software Engineering? Does Software Engineering Matter?
Introduction to Software Systems 1110/1140/1510/6710
COMP1510 Software Engineering S5
Software Engineering
Very roughly:
Software engineering is concerned with the efficient and timely delivery of software that meets stated requirements.
Introduction to Software Systems 1110/1140/1510/6710 5
COMP1510 Software Engineering S5
Software Engineering
Software project success rates:
Success 10-30% Challenged 50-75% Failed 10-30%
Source: , Software Project Failure Costs Billions. Better Estimation & Planning Can Help, 2008
Introduction to Software Systems 1110/1140/1510/6710 6
COMP1510 Software Engineering S5
Software Engineering: Financial Costs
Ariane 5 Failure, ~$500M, 1996
The error which ultimately led to the destruction of the Ariane 5 launcher about 40 seconds after lift off on its maiden flight was clearly identified in the report of the investigating committee [1]: a program segment for converting a floating point number to a signed 16 bit integer was executed with an input data value outside the range representable by a signed 16 bit integer. This run time error (out of range, overflow), which arose in both the active and the backup computers at about the same time, was detected and both computers shut themselves down. This resulted in the total loss of attitude control. The Ariane 5 turned uncontrollably and aerodynamic forces broke the vehicle apart. This breakup was detected by an on-board monitor which ignited the explosive charges to destroy the vehicle in the air. Ironically, the result of this format conversion was no longer needed after lift off.
. Baber 2002
Introduction to Software Systems 1110/1140/1510/6710 7
COMP1510 Software Engineering S5
Software Engineering: Financial Costs
Queensland Health Payroll, ~$500M, 2008-2012
[….] an audit report by the consulting company KPMG into the status of the payroll system indicates that it will cost another A$220.5 million—on top of the A$311 million already spent—to fix nine priority items that prevent the payroll of the 85,000 or so Queensland Health employees from being calculated without massive manual intervention.
[…] back in 2008, the original cost of the payroll system development was pegged at A$6.19 million (fixed price), which has steadily grown as problems such as the massive overpayment or underpayment of employee salaries ran rampant.
, IEEE Spectrum 2012
Introduction to Software Systems 1110/1140/1510/6710 8
COMP1510 Software Engineering S5
Software Engineering: Financial Costs
Facebook IPO, ~$??B, 2012
Nasdaq OMX Group Inc […] blamed “poor design” in the software it uses for driving auctions in initial public offerings. Computer systems used to establish the opening price were overwhelmed by order cancellations and updates […]. Nasdaq’s systems fell into a “loop” that kept the second- largest U.S. stock venue operator from opening the shares on time following the $16 billion deal.
“It’s amazing that both Bats and Nasdaq unfortunately failed in an inglorious way,” , the former chief operating officer at Direct Edge Holdings LLC, an exchange operator that competes with Nasdaq, said in a telephone interview yesterday. “It proves that technology isn’t infallible. There are so many moving parts that things can go wrong. That’s the lesson we learn.”
Bloomberg 22/5/2012
Introduction to Software Systems 1110/1140/1510/6710 9
COMP1510 Software Engineering S5
Software Engineering: Human Costs
Missile Defense Failure, 25/2/91, 28 Dead
[…] the Patriot’s failure was at least in part caused by a software flaw. Hitting the incoming Iraqi Scud missile was within the capability of the Patriot system, yet it missed. […] Yet to characterize this failure as a bug or programming lapse misses a larger point.
This failure can be seen as boneheaded software management. The case can be made that the problem is better traced to a framework flaw. […] More to the point, a suitable test framework would have detected the flaw, using the same compilers used in the Patriot and without impugning the skills of the Patriot developer team, who may we have excelled in other aspects of that complex software project.
, Technorati 1/11/2009
Introduction to Software Systems 1110/1140/1510/6710 10
COMP1510 Software Engineering S5
Software Engineering: Human Costs
AF447, 1/6/2009, 228 Dead
Transcripts from BAE, via avherald
Introduction to Software Systems 1110/1140/1510/6710 11
COMP1510 Software Engineering S5
Software Engineering: Human Costs
AF447, 1/6/2009, 228 Dead
Transcripts from BAE, via avherald
Findings from BAE, via avherald
Introduction to Software Systems 1110/1140/1510/6710 12
COMP1510 Software Engineering S5
Key Facets of Software Engineering
• Requirements
• Implementation
• Maintenance
• ConfigurationManagement
Introduction to Software Systems 1110/1140/1510/6710 13
Software Development Models
Big Design Up Front Waterfall
Formal Methods
Introduction to Software Systems 1110/1140/1510/6710
COMP1510 Software Development Models S6
The Waterfall Model and “Big Design Up Front” Benington 1956, Royce 1979, et al
These emphasize getting design absolutely right before progressing the development. Waterfall applies this to all phases: each each must be finalized before moving to the next.
Waterfall stages: – Requirements
– Implementation – Verification
– Maintenance
Introduction to Software Systems 1110/1140/1510/6710 16
COMP1510 Software Development Models S6
The Spiral Model Barry Bohem, 1986
This model is iterative, unlike the waterfall model.
Each iteration includes steps like those in the waterfall model. The spiral model is based on prototyping and iterative refinement.
Introduction to Software Systems 1110/1140/1510/6710 17
COMP1510 Software Development Models S6
Agile Development Beck et al 2001
value-driven
rather than
plan-driven
Agile Manifesto
We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:
Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan
That is, while there is value in the items on the right, we value the items on the left more.
Beck et al 2001
rather than
Introduction to Software Systems 1110/1140/1510/6710 18
COMP1510 Software Development Models
Formal Methods
Rigorous mathematical approach to verifying correctness of implementation.
Formal specification Verification of implementation Theorem proving assistance
(interactive theorem provers).
Introduction to Software Systems 1110/1140/1510/6710 19
COMP1510 Software Development Models S6
Which Approach?
Often viewed as a religious question…
Here’s Boehm & Turner’s take:
Agile home ground
Plan-driven home ground
Formal methods
Low criticality
High criticality
Extreme criticality
Senior developers
Junior developers
Senior developers
Requirements changeoften
Requirements do not change often
Limited requirements, limited features
Small number of developers
Large number of developers
Requirements that can be modeled
Culture that responds to change
Culture that demands order
Extreme quality
Introduction to Software Systems 1110/1140/1510/6710 20
Software Engineering Landmarks
Landmark Publications on Software Engineering
Introduction to Software Systems 1110/1140/1510/6710
COMP1510 Software Engineering Landmarks S7
The Mythical Man Month, , 1975
Brooks’ law: “Adding manpower to a late project makes it later.”
Brooks’ experience leading the development of IBM’s OS/360.
Much of what Brooks describes are what we now call ‘anti-patterns’.
• Adding manpower to a late project makes it later
– Largecomplexprojectsarecommunications-intensive
– Addingnewpeopleisverycostlyintermsofcommunications – Thecommunicationsoverheadwilleventuallydominate
• Second system effect
– Secondimplementationisdangerous
– Tendtowanttoincorporatealltheideasdiscardedasimpractical
• Scheduling
– “Q: How does a project get one year late? A: One day at a time!”
Introduction to Software Systems 1110/1140/1510/6710 23
COMP1510 Software Engineering Landmarks S7
No Silver Bullet , 1986
“building software will always be hard. There is inherently no silver bullet.” “Software entities are more complex for their size than perhaps any other human
construct.”
“Despite progress in restricting and simplifying software structures, they remain inherently unvisualizable, and thus do not permit the mind to use some of its most powerful conceptual tools”
Introduction to Software Systems 1110/1140/1510/6710 24
COMP1510 Software Engineering Landmarks S7
No Silver Bullet, , 1986
Accidental Complexity: artifacts of production of s/w Essential Complexity: inherent in the nature of the s/w
– difficulty in communicating among team: product flaws etc
– difficulty in enumerating and understanding all states: unreliability
– difficulty of invoking function: software is hard to use
– difficulty of extending programs: unanticipated states, security flaws
Introduction to Software Systems 1110/1140/1510/6710 25
COMP1510 Software Engineering Landmarks S7
Design Patterns: Elements of Reusable OO Software Gamma, Helm, Johnson, Vlissides, 1994 (aka “The Gang of Four”)
A long history of using patterns in engineering. The GoF identify 23 software design patterns:
• 5creational(createobjects)
– Prototype creates an object by cloning an existing one.
• 7Structural(describeobjectcomposition)
– Proxy functions as an interface to something else.
• 11 Behavioral (describe communication between objects) – Visitor separates algorithm from structure.
Introduction to Software Systems 1110/1140/1510/6710 26
COMP1510 Software Engineering Landmarks S7
The Five Orders of Ignorance Phillip Armour, 2000
“the hard part of building systems is not building them, it’s knowing what to build”
“If we view systems development as the acquisition of knowledge, we can also view it as the reduction or elimination of ignorance.”
Introduction to Software Systems 1110/1140/1510/6710 27
COMP1510 Software Engineering Landmarks S7
The Five Orders of Ignorance Phillip Armour, 2000
0th Order Ignorance: Lack of Ignorance. I have 0OI when I (probably) know something.
1st Order Ignorance: Lack of Knowledge. I have 1OI when I don’t know something. With 1OI we have the question in a well-factored form.
2nd Order Ignorance: Lack of Awareness. I have 2OI when I don’t know that I don’t know something.
3rd Order Ignorance: Lack of Process. I have 3OI when I don’t know a suitably efficient way to find out I don’t know that I don’t know something.
4th Order Ignorance: Meta-ignorance. I have 4OI when I don’t know about the Five Orders of Ignorance.
Introduction to Software Systems 1110/1140/1510/6710 28
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com