Designing and Maintaining Software (DAMS) - GitHub
Recommend Documents
Habitable Software. Leaner. Less Complex. Loosely Coupled. More Cohesive. Avoids Duplication. Clearer. More Extensible ?
When we are testing the way that a unit behaves when a condition is met, use a stub to setup the condition. Solution: us
Size != Complexity. âImagine a small (50 line) program comprising. 25 consecutive "IF THEN" constructs. Such a program
Page 1. Getting Lean. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Lean software⦠Has no extra parts
Getting Cohesion. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Single Responsibility. Principle. A cla
Automatically detect similar fragments of code. class StuffedCrust def title. "Stuffed Crust " +. @toppings.title +. " P
Open-source. Influenced by Perl, Smalltalk, Eiffel, Ada and Lisp. Dynamic. Purely object-oriented. Some elements of func
ASTs are tree data structures that can be analysed for meaning (following JLJ in SYAC 2014/15) ... More Cohesive. Avoids
Fixes issue #42. Users were being redirected to the home page after login, which is less useful than redirecting to the
âWe want the reading of code to be easy, even it makes the writing harder. (Of course, there's no way to write code wi
Getting loose coupling. Designing and Maintaining Software (DAMS). Louis Rose ... should not depend on low-level modules
Plug-ins. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Problem. Page 3. Current Architecture. Shareabl
Tools: Vagrant. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Bugs that appear in production and that c
Observers. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Page 3. Delivery people need to know when pizz
Reducing duplication. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Tactics. Accentuate similarities to
%w.rack tilt date INT TERM..map{|l|trap(l){$r.stop}rescue require l};. $u=Date;$z=($u.new.year + 145).abs;puts "== Almos
What is it? Several pieces of data are often used together. Why is it problematic? Behaviour that operates on the clump
R&D: sketch habitable solutions on paper, using UML. 4. Evaluate solutions and implement the best, using TDD. Probab
Clear Names. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Naming is hard. âThere are only two hard t
Why not duplicate? Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Habitable Software. Leaner. Less Compl
Clear Documentation. Designing and Maintaining Software (DAMS). Louis Rose. Page 2. Bad documentation. Misleading or con
âWe have tried to demonstrate that it is almost always incorrect to begin the decomposition of a system into modules o
Coupling Between Objects. Counts the number of other classes to which a class is coupled (other than via inheritance). C
providers are examples of issues that may need attention in online settings. .... World Congress in Computer Science, Computer Engineering, & Applied Com- ...... The work resulted among many contributions in a framework and notation for.
Designing and Maintaining Software (DAMS) - GitHub
Ruby Testing Frameworks. 3 popular options are: RSpec, Minitest and Test::Unit. We'll use RSpec, as it has the most comp
TDD & RSpec Designing and Maintaining Software (DAMS) Louis Rose
TDD in a nutshell 1. “Red” - Write a test that fails
2. “Green” - Write just enough code to pass that test
3. “Refactor” - Improve the habitability of the code
TDD as I do it today 1. “Red” - Write an integration test that fails
2. “Green” - Complete TDD loops until the test passes
3. “Refactor” - Improve the habitability of the code
TDD as I do it today 1. “Red” - Write an integration test that fails
… 3. “Refactor” - Improve the habitability of the code
TDD benefits We have a set of tests that we are confident in: - Reduces defects - Increases habitability TDD is well aligned with some (of my) habitability factors: - Encourages lean design - Discourages complex and coupled code
Ruby Testing Frameworks 3 popular options are: RSpec, Minitest and Test::Unit We’ll use RSpec, as it has the most comprehensive docs. Introductory videos are at: http://rspec.info
An RSpec example require "calculator/max" module Calculator describe Max do it "returns correct answer for a tie" do expect(Max.new.run(4, 4)).to eq(4) end it "returns correct answer when first is larger" do expect(Max.new.run(4, 3)).to eq(4) end it "returns correct answer when last is larger" do expect(Max.new.run(3, 4)).to eq(4) end end end
An RSpec example % rspec ..F Failures: 1) Max returns correct answer when last is larger Failure/Error: expect(subject.run(3, 4)).to eq(4) expected: 4 got: 3 (compared using ==) # ./spec/calculator/max_spec.rb:14:in `block (2 levels) in ' Finished in 0.01108 seconds (files took 0.0841 seconds to load) 3 examples, 1 failure Failed examples: rspec ./spec/calculator/max_spec.rb:13 # Max returns correct answer when last is larger
“We produce well-designed, well-tested, and well-factored code in small, verifiable steps.”
– James Shore http://www.jamesshore.com/Agile-Book/test_driven_development.html