A Tale of Test Pyramid, Double Loop TDD and Mocha

  • Does your unit test suite take an obscenely long time to run?
  • Do you want to optimize the cost of testing, without resorting to traditional cost-cutting stuff?
  • Do you still use debuggers for fixing production defects?
  • Do you crave for an easier way to manage test cases written by developers?
  • Do you understand TDD but don't know where to start writing the first unit test case?

If you say yes to any of the above questions, this session is for you.

This demo-driven talk will help you understand

  1. How to start with TDD in a brownfield monolithic application?
  2. How to organize test cases with cost efficiency and time efficiency as goals?
  3. How you can demonstrate the above concepts to your team, in your office, by using an open-source code repo?
 
 

Outline/Structure of the Demonstration

  1. Introduction - 3 min
  2. Common challenges to adopt TDD in brownfield monolithic applications - 5 min
  3. Demo - Test Pyramid with Continuous Delivery - 12 min
  4. Demo - Pair programming using Double-loop TDD - 12 min
  5. Summary of learnings - 3 min
  6. Q&A - 10 min

Learning Outcome

After the talk, as a participant,

  1. I will be able to write test cases with cost and time effectiveness
  2. I will be able to explain double loop TDD as a practical way to implement TDD in a brownfield monolithic application.
  3. I will be able to motivate test-driven development in my team or organization by talking about something more than the red-green-refactor mantra.

Target Audience

Developers/Managers/Product Owners/Testers

Prerequisites for Attendees

Curiosity

Drive to build quality into products

schedule Submitted 1 year ago

Public Feedback

comment Suggest improvements to the Author
  • Anand Bagmar
    By Anand Bagmar  ~  1 year ago
    reply Reply

    Hi Kiran,

    Can you share a few more details on how you plan to ensure participants get the takeaways you listed?

    • Kiran Kashyap
      By Kiran Kashyap  ~  1 year ago
      reply Reply

      Hi Anand,

      Please find the plan for each takeaway below.

      Takeaway -1

      I will be able to write test cases with cost and time effectiveness

      Approach: 

      1. Introduce test pyramid as a test "cost" and "run time" management philosophy

      2. Show examples of bad test distribution (inverted pyramid) and good test distribution (decent test pyramid) using a sample 'mocha' based test suite.

      Takeaway - 2

      I will be able to explain double loop TDD as a practical way to implement TDD in a brownfield monolithic application.

      Approach

      1. Introduce and demonstrate double loop TDD in an existing codebase, taking the example of a new user story

      2. Share the sample codebase in Github repository so that they can go and explore on their own

      Takeaway - 3

      I will be able to motivate test-driven development in my team or organization by talking about something more than the red-green-refactor mantra.

      Approach

      1. Share my story of how developers felt they cant directly start TDD at the unit test level

      2.  Share my personal experience of how introducing the double loop TDD helped developers to start trying out TDD right from the creation of user story.

      Thanks for asking this question.  This helped me consolidate my thoughts into a more concrete form than what it was.

      Please let me know if you have any more questions or suggestions.

      Thanks,
      Kiran

      • Anand Bagmar
        By Anand Bagmar  ~  11 months ago
        reply Reply

        Hi Kiran,

        Thanks for the above details. A few more questions pop in mind -

        • How are you planning to demo these concepts? Do you need any specific infra support for the demo? (ex: internet, etc.)
        • Also, some of the approaches you are talking about are not really new. How would you make it interesting for the attendees?
        • If you plan to use some slides, can you please share some of your reference / related slides?

        Thanks! Anand

        • Kiran Kashyap
          By Kiran Kashyap  ~  11 months ago
          reply Reply

          Hi Anand,

          Sorry for the delay in response. I had to call in sick due to accident.  Please find the responses inline below.

          • How are you planning to demo these concepts? Do you need any specific infra support for the demo? (ex: internet, etc.)
            • I will bring screen-capture videos of the demos and play them while i talk. Hence, no internet or infra required for demo other than projector and video player.
            • To tackle pair programming and the Q&A sessions, I will present from my laptop where I have the code and demo ready, without any need for internet.  I can show specific things that the request of audience.
          • Also, some of the approaches you are talking about are not really new. How would you make it interesting for the attendees?
            • My ideas to make the session interesting are as follows:
              • Especially for pair programming section, invite a volunteer from audience to act as a pair along with me.  They can choose to write tests or code as per their choice.  I will have to facilitate that but I am confident i can time-box the demo in this setting.
              • Present information in form of question-answers rather than wordy slides. May be an impromptu quiz (taking care not to overdo it)
              • Share pictorial information or demos instead of wordy slides
              • Opening up a time boxed discussion amidst demo if needed (I have included time for this also in my earlier time estimates)
            • Please suggest me in case you are looking for any more ways of making it interesting.  Thanks for asking this question, Anand! This made me solidify my thoughts.
          • If you plan to use some slides, can you please share some of your reference / related slides?
            • I do not plan to use slides.  I would make running notes while I talk on a notepad.
            • My WIP (consider it version 0.1) code can be found at https://github.com/kirankashyap/FlipCardReact
            • In case you suggest to use slides, I can do that also.  Please advise.

          Thanks,
          Kiran


  • Kiran Kashyap
    keyboard_arrow_down

    Kiran Kashyap - Product Usage Metrics - Practical Lessons from the Trenches

    Kiran Kashyap
    Kiran Kashyap
    Agile Change Agent
    Lowe's
    schedule 1 year ago
    Sold Out!
    20 Mins
    Experience Report
    Intermediate
    1. How do I motivate my developers when I cannot show them the financial value of the features they build?

    2. How do I prioritize which production defect to fix first?

    3. How do I choose the right solution for the customer when I have multiple solutions to solve the problem?

    4. How do I decide which feature to enhance first, using real data instead of personal intuition?

    If any of these questions keep you awake at night, this session is for you.

    In this interactive session, I will share practical lessons from great product development teams. You can hear from me about how simply creating an intentional product usage metric strategy can help in avoiding many conflicts.

  • Kiran Kashyap
    keyboard_arrow_down

    Kiran Kashyap - Behavior Driven Development in Stealth Mode - An Exploration

    Kiran Kashyap
    Kiran Kashyap
    Agile Change Agent
    Lowe's
    schedule 1 year ago
    Sold Out!
    45 Mins
    Talk
    Beginner

    “This is not what I wanted” - Is this a repeated frustration of your product owner? Do you wonder if Behavior Driven Development can help your team in specifying requirements better? Yet, is budget a constraint for starting BDD as a practice? If yes, this session is for you.

    This interactive talk will take you through practical scenarios which play out in a team, while you role-play as a developer/tester/product owner/scrum master. We will end up deriving guiding principles that anyone can use in order to influence the team towards Behavior Driven Development, even when there is no additional budget.