Monday, July 6, 2015

Ways to understand an software application

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
  1. Open your application and start go through application UI
  2. Open the source code and go through each files to get an understand of application structure  
  3. Create the classes diagram using Visual Studio/IDE
  4. Open any documents(requirements ,help .. etc) related to the application and try to understand them
  5. Debug the application using IDE.
Issues /Pitfalls with the above approach.
  1. if you follow way 1 merely, It tends to be more of manual testing and helps a little
  2. if you follow way 2 and 3, it is not much of any help
  3. 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)
  4. if you follow way 5 , It is more of waste of efforts and time
My recommended ways to understand any application.
  1. Open your application,start go through application UI to get sense of how application looks like
  2. make a list of unknown words/terminologies to make sure we get little bit of domain knowledge
  3. Get to know about those words/terminologies by going through the documents/asking someone else/ Google them
  4.  try to understand your technical design documents if you have.
  5. Make a list of most critical functionality based on your present understanding(e.g. CRUD)
  6. 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
  1. Make a list of the keywords(language specific) which you don`t understand in the class
  2. Understand all keywords
  3. Break dependencies in the class/public methods involved
  4. Write characterizing unit tests (are tests that characterizes the actual behavior of a piece of code) based on your understandings of class/method responsibilities   
  5. Make sure that you have clear intention to get sense of what this does actually not to find any bugs 
  6. debug this unit test by seeing through every line of code and DB activity if any
  7. 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