Generally , When we are given a legacy application for our own understand and later to fix the bugs. We tend to follow the ways as below
- Open your application and start go through application UI
- Open the source code and go through each files to get an understand of application structure
- Create the classes diagram using Visual Studio/IDE
- Open any documents(requirements ,help .. etc) related to the application and try to understand them
- Debug the application using IDE.
Issues /Pitfalls with the above approach.
- if you follow way 1 merely, It tends to be more of manual testing and helps a little
- if you follow way 2 and 3, it is not much of any help
- if you follow way 4 , In my view , Writing documents are kind of violation of the principle"Don't repeat yourself " and Generally gives what application is supposed to do and not what application is doing right now(we are interested in knowing this)
- if you follow way 5 , It is more of waste of efforts and time
My recommended ways to understand any application.
- Open your application,start go through application UI to get sense of how application looks like
- make a list of unknown words/terminologies to make sure we get little bit of domain knowledge
- Get to know about those words/terminologies by going through the documents/asking someone else/ Google them
- try to understand your technical design documents if you have.
- Make a list of most critical functionality based on your present understanding(e.g. CRUD)
- Make a list of classes and discover their responsibility corresponding to the listed in step 5
Follow the below steps for each of classes listed in the step 6
- Make a list of the keywords(language specific) which you don`t understand in the class
- Understand all keywords
- Break dependencies in the class/public methods involved
- Write characterizing unit tests (are tests that characterizes the actual behavior of a piece of code) based on your understandings of class/method responsibilities
- Make sure that you have clear intention to get sense of what this does actually not to find any bugs
- debug this unit test by seeing through every line of code and DB activity if any
- Stop when you feel that you got a sense of responsibilities the class has
By following the steps above, We can get more confidence while working with a legacy application
No comments:
Post a Comment