Coder Social home page Coder Social logo

vincentdnl / bugszero-kata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinsson/bugszero-kata

0.0 1.0 0.0 8.78 MB

Practice Designing code for less bugs

C# 39.13% Java 12.53% JavaScript 2.37% TypeScript 10.06% Kotlin 11.86% PHP 11.95% Shell 1.34% Swift 10.77%

bugszero-kata's Introduction

BugsZero Kata

Bugs are optional, they sneak into our code much thanks the design choices we do, or fail to do. Let's try refactoring some existing code to make it more bug-repellent!

You'll practice reading code, looking for parts where it is likely that developers would create a bug if they extended the code. Whenever you've found such a weakness in the design your challenge is to strengthen the design in order to make that kind of bug very unlikely, or even impossible!

First Identify a bug or a weakness in the design. Then Explain what feature could cause a bug. Or how the design contributed to its introduction. This is important, simply saying another solution is better avoids thinking of why it is actually better. Finally Explain or refactor the code to show the new design.

Prefer small changes in the design, for instance before applying a design pattern try simpler things, like maybe ExtractConstant or replace conditional logic with a map/dictionnary.

Where do I start?

Beginner

Make sure you know of a few ways to design away bugs, by looking at a few examples

Have a look at the long list of common bug-patterns, mostly unnecessary weaknesses in design. Beware, those are a bit terse, most patterns need to be explained.

Intermediate

We've found some weaknesses for you. Pick your choice in instructions-intermediate.md

Advanced

If you'e already accustomed this thinking this way, have a look at instructions-advanced.md

Solutions

After doing your version, have a look at the various solutions in the form of merge-requests. It is easy to see what the change was using the diff-view. They are meant to be (on of) the best trade-offs for the given problem. There's always trade-offs, but if you find a better or simply good alternative, please fork and merge-request and we'll reference it.

Next steps

Go use this on some other code base, like your project!

Give us some suggestions in the issues.

Resources on #BugsZero

Some slides specifically on code design

The general part 15 min intro or go for the full presentation

Blog posts

Bug teams

Contribute

Contributions of all forms are welcome. Submit another language by fork/merge-request. If you're missing something or hava a question please create an issue.

bugszero-kata's People

Contributors

dertseha avatar fredericruaudel avatar fvn-linagora avatar martinsson avatar sebcanonica avatar sebn avatar vincentdnl avatar

Watchers

 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.