1. Open Xcode
2. Make sure Xcode is 8.x
3. Open Main.storyboard
4. Search for TextView in the Object Library
5. Drag over to Storyboard
6. Run
1. Open Terminal
2. cd /path/to/HelloWorld
3. Run the command
xcodebuild build -project HelloWorld.xcodeproj
-scheme HelloWorld
-destination 'platform=iOS Simulator,name=iPhone 7 Plus'
You can't TDD w/o unit testing
TDD means writing the tests before the code
TDD is more painless than classic unit testing
You can unit test w/o TDD
Unit tests don't mandate when you write the tests
Unit tests are often written at the end of a coding cycle
Features
- User gets valid result when
dividing divisor by dividend
- User can not divide by zero
1. Create Xcode project called Division
2. Add two text fields, divide and results label and button
3. Create IBoutlets, IBActions
4. Create Calculator object
5. Create Unit test for feature 1
6. Run test - test will fail
7. Fix Calculator code so test passes
8. Create Unit test for feature 2
9. Run test - test will fail
10. Fix Calculator code so test passes
11. Run test
12. Refactor - fix ViewController code
13. Turn on code coverage
14. View code coverage
Write a function to convert from Arabic numbers to Roman Numerals
Write a function to convert from Roman Numerals to Arabic numbers
1. Create ArabicToRoman project in Xcode
2. Check Unit Tests
3. Open ArabicToRomanTests - use the two screens in Xcode
4. Create ArabicToRomanModel.swift
5. Create toRoman stub function
6. Create testConvertToRoman test
7. Run test from command line, test will fail
8. Fix toRoman stub function
9. Run test from command line, test passes
10. Refactor
11. Repeat for second feature
Feature 1 - Display list of Zodiac Signs
Feature 2 - Display descriptions of Sign
Feature 3 - Display daily horoscope
https://medium.com/@ynzc/getting-started-with-tdd-in-swift-2fab3e07204b
https://github.com/samantha-wong/FizzBuzz
https://gist.github.com/kumo/472043819fec7a3737f8
https://github.com/pigmonchu/TDDiOS
http://rshankar.com/test-driven-development-in-swift/