Giter VIP home page Giter VIP logo

dvd-shop's Introduction

TDD workshop

What I know

Test Driven Development

You got tests driving your development... test first... then the code that should be tested.

I helps with:

  • thinking about the code
  • thinking about what is needed
  • how can I achieve what is needed...

Questions

When are writing tests:

  • You are publishing your intent for the code.
  • You are stating what the code is doing and how it should behave.

Why do I need to use TDD? - lunga

  • It helps you to learn how to write decoupled code.
  • Learn how to create code blocks that can be used together to create more maintainable software.
  • Help us not to be afraid to make changes in our codebase.
  • It's a way of understanding other people's (you 4 weeks ago) thoughts about the code.

How does TDD make my code better? - lihle

  • It decouples your code - it drives the seperation of concerns.
  • It drives the architecture / structure of your codebase...
    • How the various pieces of code relate to each other.

How does it help me? - lunga

What is Mockito? - shawn/minenhle

  • It helps us to create mocks of interfaces - a thing that is not the actual thing. It looks like the actual thing...
  • It can create a 'silent' mock - it doesn't fail but doesn't do much.
  • You can add selected behaviour using when
  • You can verify that that Mock was used correctly using verify

How does one know if a class is not testable? - bheki

  • I can't write a test for it:
    • I can't check the result of an action
    • I can't verify if something happened that should have happened
    • The logic is too intertwined...

How does one know if a class is testable? - bheki

How do I unit test my classes? - lihle

Is there and alternative to unit testing to improve our code? - bheki

How would I write a test for code that doesn't exist yet? - lunga

How do I unit test my classes that is using the database? - phumlani

Can you unit test without hard coding an expected a result? - minenhle

How do I unit test my commands?

assertEquals("Hello, Andre", commandProc.execute("greet Andre English"));
assertEquals("Hello, Andre", commandProc.execute("greet Andre"));

How do I prepare the data in my database so that the unit test will work correctly as it depends on some existing data in the database? - shawn

dvd-shop's People

Contributors

codex-avee avatar

Watchers

Andre Vermeulen avatar James Cloos avatar Cara Turmer avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.