Software Engineering Journey: Inside the Methods

It would be nice for us to realize that if we adopt an approach such the one I presented earlier in one of the posts, our development related activities would become a lot easier. I presented my strategy as a two-step procedure. In the first step, you generate skeleton code from the design. In the second step, you implement the methods. Once you have done that, you are done and dusted with the process of implementation. How accurately our software works depends on how accurately we implemented the design and how accurately we developed the design. How accurately we developed the design depends on how accurately we followed the specifications and how accurately we gathered the requirements and specifications. How accurately we gathered the requirement, in turn, depends on how accurately we followed the requirement gathering advice chanted in endless texts on software engineering texts.

Anyhow, I decomposed the implementation of methods into two parts. One is to provide inputs and gather outputs from the methods. We have to understand very vividly how method IO works. Once you understand that life becomes extremely easy for us. For, what remains after that is to implement the logic of a method.

What goes inside the body of methods? Well, some methods are simply one-liners. They simply print a message or return a value. In certain cases, they apply a mathematical operation to a variable and return it. Sometimes, you have to perform disk IO. When methods become a little more complex, they contain some loops and rules employing switch statements and structures containing if/else rules. All of this should be a trivial matter if you have been exposed to even a little bit of programming at some point in the past.

Where does the logic for implementing such kinds of method functionality arrive? Well, it really requires some thinking effort on part of the developer. You have to understand the functionality promised by a method by reading the requirements specification document or the design document. Depending on that, you implement your logic.

In computer science, we are taught all sorts of courses that involve some kind of problem-solving. A course on data structures and algorithms is a nice example of that. Sometimes we simply fail to appreciate the greater benefits such algorithms can yield. More dynamic students simply trash the contents of such courses as mere brainstorming. Such courses are nonetheless important as they provide us with valuable tools for thinking and implementing solutions to small problems. A propensity for such problem solving can help you a great deal in implementing your methods.

Some methods would require functionality that you cannot easily fathom. Consider a flyPlane method that takes in over a dozen inputs and outputs a handful outputs. The job of such a method is to fly a plane in adverse conditions. How would you implement the functionality of such a method?

Indeed, it may be impossible to conceive the code for such a method. It is for this kind of methods that machine learning plays a handy role. And we shall begin talking about that in due course.

Photo by shinya

If you found an error, highlight it and press Shift + Enter or click here to inform us.

CC BY-NC-ND 4.0 Software Engineering Journey: Inside the Methods by Psyops Prime is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Leave a Reply