Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Testing legacy code

  • 11-11-2014 05:44PM
    #1
    Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭


    Does anyone know of a good book or website that goes it strategies for (unit) testing legacy code that wasn't designed with testing in mind, such a no DI seams.

    Language is C# if that makes a difference.


Comments

  • Closed Accounts Posts: 4,436 ✭✭✭c_man




  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    c_man wrote: »

    Being 10 years old doesn't matter ? The principles still hold up ?


  • Closed Accounts Posts: 4,436 ✭✭✭c_man


    Smoggy wrote: »
    Being 10 years old doesn't matter ? The principles still hold up ?

    Nope! That book more than anything else, helped me getting a particularly... troublesome module under some sort of control.

    In fact I started a thread kinda like this a year ago you should check out - http://www.boards.ie/vbulletin/showthread.php?p=87011342


  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    Thanks C_Man - I have that on order now :)


  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    Have I dreamed these up ?

    Are there such things as AutoMocks, where their functionality would be to mark code for mimic, record interaction on the first play through and mimic it back when under test ?

    It's more than possible that I have made this up :) But If I haven't it needs to be developed. Google hasn't shown me anything, but I don't really know what I'm searching for :)


  • Advertisement
  • Posts: 9,954 ✭✭✭ [Deleted User]


    C# = legacy code :-)


  • Registered Users, Registered Users 2, Paid Member Posts: 14,174 ✭✭✭✭Lemming


    Tow wrote: »
    C# = legacy code :-)

    I'm almost afraid to ask this question for fear of feeding a troll; but what exactly isn't legacy code then if C# is considered legacy code?


  • Registered Users, Registered Users 2 Posts: 372 ✭✭NinetyForNone


    Lemming wrote: »
    C# is considered legacy code?
    From Wikipedia page on Legacy code
    ...source code inherited from someone else and source code inherited from an older version of the software.


  • Moderators, Sports Moderators, Regional Abroad Moderators, Paid Member Posts: 2,692 Mod ✭✭✭✭TrueDub


    Alternatively, legacy code is code you've inherited from someone else which doesn't fit with the latest techniques, or with the fad-du-jour in that particular programming language or genre.


  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    I can assure you this code is legacy code, you too would agree if you saw it.


  • Advertisement
  • Closed Accounts Posts: 4,436 ✭✭✭c_man


    Lol. I'd say that legacy code, is any code that is not under any kind of test... Now why can't we just all get along? :)


  • Moderators, Technology & Internet Moderators Posts: 1,338 Mod ✭✭✭✭croo


    Smoggy wrote: »
    ...where their functionality would be to mark code for mimic...
    Don't know about that bit ...
    Smoggy wrote: »
    record interaction on the first play through and mimic it back when under test ?
    But the Open Source Selenium project does this for webapps


  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    c_man wrote: »
    Lol. I'd say that legacy code, is any code that is not under any kind of test... Now why can't we just all get along? :)


    +1
    I like this definition.


Advertisement