Sunday, February 2, 2014

Case for a Systematic Design Methodology

"The main task of engineers is to apply their scientific and engineering knowledge to the solution of technical problems, and then to optimize those solutions within the requirements and constraints set by material, technological, economic, legal, environmental, and human-related considerations [1]." This classic definition of the tasks of engineers sets up will a discussion of why systematic design is important for engineers. Engineers must solve problems given to them, which is in contrast to an inventor who gets to choose his problems and in contrast to a hobbyist who solves problems just for fun. The key consideration is the engineers are given jobs that they have no clue how to solve, and they are under very specific constraints.  A constraint on any engineer job is the time frame that a solution MUST be developed.

First, what is a systematic design method? A systematic design method requires the engineer to follow a specific set of steps during the design process. The steps can be flexible, but must be followed in the correct order.

First, a systematic design methodology should be used because randomly hoping for a bolt of inspiration to solve a problem depends heavily on the luck of the designer. In general relying on luck is not a good thing when given a specific time frame to solve a problem. Certainly, the more you think about a problem the more likely you are to come up with a solution because your brain has more time to make connections, but relying only on bolts of inspiration is a bad idea. In addition, many optimal solutions are not intuitive, so that it is doubtful if a non-systematic method would ever find them.

Second, a systematic design method helps generate a time frame or time line to help estimate key mile stones and completion times. Every client wants to know when they can expect a solution. A systematic method of design allows you to generate a specific timeline of when you expect certain aspects of the project to be finished. In addition, if things are not on schedule, it is simple to estimate how much the project is deviating from the original schedule and estimate how much additional  time will be needed.

Third, a systematic design method provides a common vocabulary or understanding of the current stage of design which promotes clarity. A common problem that I have found while working as an engineer is discussing design of an object on  a different level of abstraction of the design than what the other person is thinking. For example, I might be thinking big picture design, while they are discussing implementation details. If we both knew what stage of design we were working on then, the appropriate level of abstraction of the problem and solution would be more clear. In addition, a systematic design provides a framework so that everyone knows what to expect next so what all the engineers can be on the same page. Because modern design problems are far too complex for a single individual to solve by himself, engineers work in teams. Clear communication among the team is key solving any problem.   Non-engineers also benefit from a clear understanding what to expect in each design stage.

Fourth, a systematic design method allows the engineers to design for several X. Design for X includes design for manufacturing, design for sustainability, design for recyclability, design for ease of use, design for safety, and many others.  Each design for X burdens the engineer with another set of constraints that must be considered. To attempt to think about all the design for Xs at the same time would be impossible. However, by systematically considering each design for X, the product has the best chance of meeting each design for X.

Finally, a systematic design method produces documentation that shows clearly the reasoning of the engineer in a logical progression. An important part of design, is showing that the design has considered many possible alternative solutions and the final design was proven the best. Justifying your design is essential to prevent someone else from second-guessing of your engineering ability. In addition, by clarifying your assumptions and considerations during the design process, then when these assumptions change, the impact of the change can be easily found. Also, documentation aids in communication amongst engineers and non-engineers.

A systematic design method is often cited as killing creativity, but in reality a systematic design supports the engineers creativity by expanding his view and then focusing it on the real problems. The benefits of systematic design are well known, but often difficult to practice because we naturally want to jump to solution that we think might work. 


[1] Pahl G., Beitz W., Feldhusen J., & Grote K.H. (2007). Engineering design: A systematic approach (3rd ed.) Springer-Varlag London.


Saturday, January 4, 2014

Git

I use a Git  often to help share my code with other people and to back up my work on a remote server somewhere. At my previous job we used a paid service from GitHub to help manage our code. Previously we had been using Dropbox to store our code which is a really horrible way to share code. Dropbox automatically syncs a folder across all  devices (primarily computers). While programming with several people this can be a problem because I might be working on a section of code A, and my colleague might be working on section of code B. I modify the code in a way that effects the functionality of sections A and B, and then the person working on section B doesn't realize that changes have been made and can't figure out why things aren't working. In other works, auto-sync while sharing code is a bad idea. .

In contrast, Git allows developers to control the synchronization of code with other developers by using a variety of tools and techniques. When you have finished something note-worthy, then you make a "commit" of your code. This is a saved snap shot of everything in your git repository (folders where you setup git). You can share this snap shot by uploading it to a server, and then sharing it with others. GitHub and Bitbucket are the two companies that I use their services for my git server. If your colleague downloads the code, makes some modifications and then uploads it to the server again, then you also can see that changes have been made, and git will force you to merge the two commits (snapshots of all the files). You can change the merging strategy that git will use. If git cannot auto-merge the two snap shots, then it will let you know and ask for your help.

Git is different than Dropbox as well because git saves the differences between commits of your code. So instead of uploading a file to a git server, git will only send a diff file that describes what is different about your code when compared to a previous commit. The diff files are saved so that if you need to go back to a previous version of the code because something is not working, then it is trivial to tell git to undo the differences. This ability to go back has saved me so many times from wasting hours and hours of work!

Git also allows you to have several versions of the code by making different branches. So if you are working on feature X and your friend is working on feature Y, but you don't want to bother with merging the two until you both finish your features, then you can just make 2 branches of your code. Branches can be merged together in a control manner later on.

Git is simple, but at the same time it is very complex to full use its power to the max. I'm sure I don't use all of its potential, and every time I need to do something that is out of the ordinary set of commands, then I always Google to find the correct syntax.

Dropbox, Google Drive, SkyDrive, and Ubuntu One are superior to git when you have a file that is in a non-human readable format. For example, a .exe or .bin file shouldn't be uploaded to git because the diff file is meaningless.

Github offers several articles on how to setup git easily. I personally use Bitbucket as my primary git service provider because I can have free git accounts without making them public (in contrast to github). The only constraint on Bitbucket is that you are limited to 5 team members for a free account.

Git is a valuable too for any engineer working on software development. I've found that most of my mechanical engineer colleagues are ignorant of tools like Git to help them keep track of their code. Instead they are not backing up their code daily, emailing huge sets of files to share code, storing code long term on CDs, and other bad code management practices.  So if you are one of those engineers who knows more about how to stack blocks to prevent overflow than what a stack overflow means, then I'm guessing you might be one of those people who needs to learn how to use git for your next coding project.