Applying Fail Fast in Software Development - PowerPoint PPT Presentation

About This Presentation
Title:

Applying Fail Fast in Software Development

Description:

Our mantra for year 2015 is “Fail Fast”, and I have been thinking of applying this mantra in my day-to-day software development life. – PowerPoint PPT presentation

Number of Views:14
Slides: 10
Provided by: AzilenTech
Category:

less

Transcript and Presenter's Notes

Title: Applying Fail Fast in Software Development


1
Applying Fail Fast in Software Development
2
Intro
  • For any regular programmer, the motivation while
    writing code is to reduce defects and avoid
    system from crashing. Such a motivation results
    in implementing defensive coding. Every software
    engineer has to agree with debugging concept.
    Debugging is most difficult part of software
    development cycle (SDLC). It is also observed
    that the defects which are easy to produce are of
    the least concern to the developer. In fact, the
    criticality of the defect is directly
    proportional to the frequency of its occurrence,
    rather than the actual flow that the defect
    breaks. My observation teaches me the most of the
    time these rarely producible defects are due to
    defensive coding.

3
Heres an example
Above code snippet is good example for defensive
coding.
4
  • FirstOrDefault returns a first item of
    potentially multiple (or default if none
    exists).
  • SingleOrDefault assumes that there is a single
    item and returns it (or default if none exists).
    Multiple items are a violation of contract, an
    exception is thrown.
  • Here there is no possibility of getting more than
    one user with provided username and if it
    consists multiple users with same names, then
    system will eventually fail (Not instantly).
    Developers are aware of results, as outcome would
    be single user or null. But, developer prefers to
    forgive the system rather than failed results
    from the system. Tough there is a high chance of
    injecting one of that rarely producing defects.
  • And also, you might be wondering to prepare our
    system fragile. I would say NO, because this
    mantra makes our system more robust and amenable.
    Spartan always says the more you sweat in
    training, the less you bleed in combat, and the
    same applies here the more defects found in
    testing, the lesser are produced during
    production.

5
Heres another example
6
  • You can notice the difference of Fail Fast
    approach which is mentioned in the above code
    snippet, that developers wont assume that the
    conversation would correctly execute.
    Nonetheless, the system works more fragile and
    hence to be sure of successful execution and
    conversation the latter approach is undertaken.
  • This approach hasnt come up overnight. The
    learning in the aforementioned two examples has
    come after letting the system fail for the first
    time, so as to conclude on a better and more
    stable approach later. Hence, I would prefer to
    fail fast and fail visibly.

7
Benefits of Fail Fast approach
  • Benefits of Fail Fast approach is, you will fail
    instantly and find the exact problem in your
    system. There will be exceptions for some really
    nagging defects, but for some incidents such as
    the following the fail fast approach will be most
    helpful
  • Getting/Setting Configuration parameters
  • Fetching data from database (most of time I see
    data access layer is always in try/catch so if
    connection goes down it always returns null, and
    I dont know what actually happened avoid this)
  • Your business rules are clear (for e.g. one
    username will be mapped to single unique user,
    never multiple)

8
  • Original Source
  • http//www.azilen.com/blog/applying-fail-fast-soft
    ware-development/

9
Thanks You www.azilen.com Let us know if you
have any Question! info_at_azilen.com
1-972-325-2243
Write a Comment
User Comments (0)
About PowerShow.com