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.


Sunday, December 29, 2013

World Map App Update

World Map App continues to gain users, and the cost of maintaining the app is fully covered by revenue generated by the advertisements. I plan to fix a few bugs and improve the app soon, but I have not had time recently to work on the app. As far as I know, World Map App is the only map in Russian that offers maps with Russian labels. I believe this is the main reason for its popularity.

About 2600 people have app installed. The app has experienced steady growth since release of version 6. Version 6 was exactly the same as version 5 except that the app would automatically download all the maps in the user's language. The whole idea in version 5 was to allow users to pick and choose which maps they wanted rather than forcing them to store unused maps on their phone. However, as soon as I release version 5, the number installations suddenly slowed down dramatically. I believe this was because users did not want to spend the time to download new maps, or users couldn't not figure out how to download new maps. To combat this, when the app is run for the first time it automatically downloads all maps that are in the user's language.


Russian speakers continue to be about 70% of the users.


Not surprising, the top three countries where World Map App is installed are Russian speaking countries


I've included advertisements in the app to help cover server costs to host the SQL database and generic storage containers for the images. Originally, I was hoping to make a significant income with the World Map App, but it is very difficult to make much money on advertisements developing apps for Android that are free.
I've shown about 36000 advertisements, and users have clicked on ads about 550 times. I've generated about $30 on advertisement clicks.  The image below shows the earnings on a daily basis starting in August 2013.

I average about 300 advertisement impressions per day, and I average about 4 clicks per day.

My server costs include both the SQL db on Windows Azure and the image storage on Google Blob Storage. Azure costs (not including December) are shown in the image below. As of the moment I'm writing this,  December 2013 is estimated to cost $3.79.

My Google storage costs for Map App have been about $4.84.

Based on the cost and expense, I've made $2.09. Not much, but at least I'm not losing money, and the experiencing of developing an app has been invaluable.

Saturday, December 28, 2013

Product Planning (Stage 1 of product design)

Product design includes five main stages. A super simplified explanation of them are presented below. 
  1. Product planning. The company strategically finds market needs, their company strengths, and determines several  potential products that they might develop. Using all this information they form a strategy of which  products that they will design to meet the market needs and company strengths. 
  2. Product specification. After a product is generally defined for company planning purposes, the engineers and company managers need to define in some detail what they are attempting to design for a specific product. A long list of requirements that the product must meet is defined. 
  3. Conceptual design. The engineers take the requirements and create 1-3 final ideas on how to meet these requirements.
  4. Embodiment design. The engineer takes the 1-3 ideas and fleshes them out in much more detail. For a mechanical engineer this normally includes using CAD. As more information about the design is available, the ideas are evaluated and narrowed down to one design for the product. 
  5. Detailed design. The product's manufacturing instruction, user manual, and other documentation is finalized. 
At school and generally on the internet, teachers focus on teaching , stage 4, embodiment design. However, all the stages are important. In my experience working as a paid engineer, small companies don't follow these 5 stages of design and the results are horrible. It is easy to have a good idea (which normally means you have a good idea for how to implement something, stage 4), and the company makes a valiant effort to get the idea to work. However, as soon as you include someone else in the design project, then things begin to fall apart because they don't see why your idea is so great and can point out several reasons why it is not great at all. Since you never clearly found out what people want (stage 1), you never defined what exactly you were trying to do (stage 2), and didn't consider alternative methods to solving the overall problem (stage 3), when someone else comes along and ask for justification for your design, you have nothing to show. For me, I was the new person, and I kept on asking "what are we actually trying to make (stage 2)? why are making it (stage 1)? why didn't you try something else (stage 3)?". Unfortunately, I never was given legitimate well documented answer to these questions. 

Recently, I've discovered another facet of product planning (stage 1). Once we have an idea of the product(s) we want to create, then we can create a strategy for how several iterations of the design will progress. In general when starting something new, it is best to keep things simple. The first iteration of a product that is released to  customer's should fulfill the basic requirements without bells and whistles. During product design enough things will go wrong so that creating a product which fulfills its core functionality well will be challenging enough.  

During product planning, the engineers can select core product functionality as the requirements for the first iteration, and then for later iterations incrementally increase the complexity of the product by adding features to it. Hopefully, the product specification for later iterations will also be influenced by customer feedback. 

The key idea I want to communicate is that you should plan out the iterations of your product as the very first step in product design. The first iteration should be as simple as possible. Later iterations should add features that add value. A common mistake is to make your first iteration far to complex with cool ideas. However it is also a mistake to totally forget your cool ideas. Cool ideas (features) can be planned for in later iterations of your product. 

Sunday, September 1, 2013

World Map App Version 5


News

Today I released World Map App version 5! Version 5 has a lot of new features in it and fixes no known bugs. Version 5 lets the user download new maps to their phone from a server so that they can customize the user experience based off what they want or need.  Because large images take up a lot of disk space, I didn't want to embed a lot of large images into the app and thereby make the app size around 30 MB. So instead, I let the users choose what they want and only downloaded want they need.

Server 

I'm using Windows Azure Mobile Services in the background to host my database. I downloaded the official SDK for connecting to Azure from Android and was able to connect my app to Azure after hours of work and looking at the test example. Azure provides an easy to use back-end for a mobile app.  I looked at Amazon Web Services, but it was too complicated; the Google App Engine examples were not working, so I ended up using Azure.

 

Also, I generated a small website backend to connect to the Azure server and allow me to modify the database. The website is a heavily modified version of the javascript,html example app from Azure. I learned a lot about javascript, jQuery, and html 5 while working on my website.


An important part of the table that hosts the data, is the column "in Production". If this is set to "true", then the map will appear on all mobile android devices when someone clicks the "Download Maps" button. This lets me make modifications to a row before I put it in production, or easily pull a row out of production with the click of a button.

The actual images are stored on a Google Storage (which is an unstructured blob type storage). I used Google to store the images because it was really easy for me to use there "Web Console" to choose the images I wanted to upload. In the future I plan to use Azure Blob storage, but the ease of using the "Web Console" was the reason I used Google Storage for now.




Statistics

Since version 4, World Map App has more than doubled in its user base. Like before, most users speak Russian (nearly 70%), and more than half of users are in Russia.


I translated the app into Spanish, but the app is having a hard time gaining a user base in Spanish. Hopefully with the new features, I should be able to add maps that are written in Spanish and are of Spanish speaking countries. This should help make the app useful to Spanish speakers. 

About 3/4 of users that had version 3 of World Map App installed version 4 (as of 11 days after the release of version 4). This statistic is interesting because it tells me that some people don't update their apps, so that it is important when I release a new version that it works well because who knows when it will actually get updated by some users. 
In this line graph, you can see how the number of people with version 3 installed on their device flat-lines which means they just don't update their apps (version 3 is blue and version 4 is in green). 



Sunday, August 25, 2013

Balmer Leaving Microsoft

I read this article, Balmer Legacy, and found it really interesting. Perhaps I'm a Microsoft fan because I really hate being put into the one size fits all box that Apple products have created, but I think the article hits on the important points about Balmer. Balmer's success was in the behind the scenes arena.

"Looking through the small screen of a smartphone, it’s easy to miss the bigger picture. Microsoft is struggling through the downward cycle of PC sales, but it’s making small but significant gains in phones and search. Its cloud-computing platform is a serious contender and it’s gearing up to launch the next Xbox, building on the huge popularly of the current Xbox 360. ...

While Steve Jobs was winning with the iPod, iPhone and iPad, Ballmer was winning over companies with Microsoft servers and business software. Jobs tried and failed to break into the enterprise server business and nobody cared; Ballmer struggled with music players and phones and was mocked."

I'm not sure that Microsoft is winning the backend of devices either, but it certainly is in the top 3 with Amazon Webservices out in front. But the point is that most people who mock Balmer (at least that I know), really don't understand all the work that goes into running a dynamic website, a backend for a mobile platform, scaling VM across geographic regions based on loads, and all the other things that happen in the background to make devices work well with a cloud connection. 

I certainly think that Balmer has had some mistakes, but over all the general characterization of Microsoft as being backwards and lacking innovation (with Balmer being the poster-boy) is incorrect.  

Saturday, August 24, 2013

World Map App Version 3

I finished version 3 of World Map App. The new release includes a new set of icons, and removal of the menu in the about activity. Also World Map App is now available in Russian!!! My wife was kind enough to do the translation for me.

Users should expect to receive the update in the next 24 hours.

https://play.google.com/store/apps/details?id=com.stackingblockstopreventoverflow.blogspot.worldmapapp&hl=en

I'm working on a CAT bus app right now. The app will show the current location of each bus on its respective route. The app is much more complex than "World Map App" because I'm doing something besides just showing images. I'm using a sqlite3 database to store the bus stop information, and I'm creating nice complex SQL statements to select the exact bus stop time information for the correct season, day, and time.