Skip to content

Instantly share code, notes, and snippets.

@gelendir
Last active August 29, 2015 14:00
Show Gist options
  • Save gelendir/11068097 to your computer and use it in GitHub Desktop.
Save gelendir/11068097 to your computer and use it in GitHub Desktop.
tdd

commands

beginner

  • cat
  • echo
  • date
  • sleep
  • mkdir

intermediate

  • grep
  • find
  • cp
  • tail
  • ls
  • md5

advanced

  • ps
  • gzip / gunzip
  • tar
  • telnet
  • diff
  • curl / wget

User profile

  • White male between 20 and 40
  • Has some experience programming in python
  • No/Little experience in writing unit tests
  • Finds it hard to write good tests
  • Has heard about TDD, would like to learn more about it

Learning Feedback

  • Ask them to submit unit tests to github
  • Group activities :
  • Concept map on what is TDD
  • Find test names in pairs

Concepts to show

  • TDD Cycle

  • Write a failing test

  • Make it pass

  • Refactor

  • the py.test library

  • def test_

  • fixtures

  • capsys

  • tmpdir

  • project/directory structure

  • running the tests

  • TDD Pairing

  • Ping / pong

  • Make test pass / Write failing test

Schedule

9h30

  • Installation and setup

10h

  • Introductions
  • Objectives
  • Ask experience level
  • Horror story

10h15

  • Environment setup
  • virtualenv
  • pip install requirements.txt
  • py.test
  • TDD Demonstration
  • TODO: Find simple use case for demonstration
  • running tests

11h00

  • First sprint
  • test scenario : cat

11h45

  • Review

12h00

  • Lunch

13h00

  • Second sprint
  • test scenario : date

13h45

  • Review

14h00

  • Third sprint
  • test scenario : ls

14h45

  • review

15h00

  • Fourth sprint
  • test scenario : tail

15h45

  • Review

16h00

  • Fourth sprint
  • test scenario : grep

16h45

  • review
@gelendir
Copy link
Author

Je suis d'accord que cat peut devenir plus compliqué lorsque l'on commence à gérer des gros fichiers, mais je crois que ça ne vaut pas la peine de le déplacer. Il ne faut pas oublier que nos participants ont seulement 45 minutes pour écrire les tests et on vise seulement à tester les cas d'utilisation les plus communs.

Par contre je suis d'accord pour ls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment