Thursday, October 28, 2010

User Stories

An important aspect of designing a system is to put yourself in the place of a user of the system.  What is important user may be different than what is important to a designer.  With that respect, you must always keep your users in mind because they are ultimately the ones who will be impacted the most by the design.

For the Solar Decathlon, it is important to always keep the goal of the competition in mind which is to design, build, and operate a solar powered house that is cost-effective, energy-efficent, and attractive.  Here are some problems I hope to address while developing some software for the competition.

Maintenance of the system

Since the house must be solar powered, it is important to maintain system and to make sure that you are getting the most out of each component.  As a user, you may not be thinking about what condition your battery is in as it wears over time.  This feature is already provided by laptops, which warn the user when power levels are low or to get their battery serviced.

While keeping a watch on your battery's condition it would also be a smart idea to keep track of the condition of the solar cells themselves.  You could measure the condition of the cells with the ratio Amount of Energy Trasfered / Amount of UV Radiation Exposed.  While this info may not be exciting to the user, it is a very simple measurement that can be taken to provide the user with the information needed to maintain their house properly.  While on the idea of panel condition, solar cells degrade at a slow rate (about 20% over 25 years), and it may not necessarily to monitor the output of each individual cell, but rather to see which cells are actually functioning.  Since the solar encasing for the house is designed to go around the house, as opposed to conventional solar panels that sit on top of the roof, they may be more prone to physical damage as opposed to wear over time.

The aquaponics system seems to be another integral part of teamhawai‘i's house.  I believe monitoring the water conditions would be a crucial aspect to the competition.  For aquaponics there are three major fields you want to monitor: water temperature, pH levels, and electrical conductivity.  By providing the user with this data, they can respond to problems with their system before problems scale out of control.

Apart from the solar energy and aquaponic system, the two water tanks play another important role in the house by both providing water and storage for grey-water, as well as providing some heating capabilities to the house with the latent energy that is absorbed and released by the heat-insulating material that is contained within the tanks.  So it goes without saying that monitoring temperature and water levels would be important to the user.  But what does it mean to provide these readings to the user?  The user shouldn't have to do any calculations of their own when they try to take a warm shower or want to cool down the internal temperature of the house.  So why not implement a system that uses these data values to help the user manage their energy consumption?  A graph projecting future power levels based on tasks that the house is providing wouldn't be too far of a stretch.

Attractiveness

After all the maintenance systems are established we can get into the fun things that would make any user want to buy the house.  One that I thought of applied to the aquaponics system.  Keeping a mini database of the current plants being grown, and of the fish that are in the tank would be a nice educational touch to the system as a whole.  Like a mini aquarium / plant nursery that could display info on the organisms that are part of the system.

We want a system that is easy to manage.  Computers that are incorporated (i.e. display panels) to the structure of the house would be a nice touch to provide user ease of use.  And like most technologies today, having mobile devices (i.e. smart phones) would have to be essential.  These technologies could allow the user to manage the house at a few simple clicks, whether at home or not.  For example setting the temperature of the house on your way home from work.

Finding a way to network your house in a way that services are aware of each other is another important feature I think that should be incorporated into a 'smart house'.  What I mean is, I would like the systems to communicate with each other.  The first thing I can think of is say you want to turn down the temperature of the house, but doing so would cause you to exceed the amount of energy that has been generated because of other tasks that are being preformed around the house.  It may be possible for the house to arrange task priorities, and to maybe turn down energy usage in some areas where it's not as important in order to delegate power for the new task.

I believe the air conditioning system should also be smart.  There should probably be some software that can keep the house at a certain set temperature in the most efficient way possible.  Taking readings from both internal and external ambient air temperatures as well as humidity levels would be essential.  Based on these readings the system could pump out air at certain times to keep the system cool without the user having to worry about it.

Tuesday, October 26, 2010

WebsiteUsabilityReview

Today, it seems like just about anyone can create create their own website in a few minutes with the help of a startup wizard.  Whether people know it or not, there are conventions and standards that they should followed when designing page layouts.

My Background: Ka Leo
Dummy layout for kaleo.org home page
I've recently became interested in web development this past summer after working as the design editor for over the past year at Ka Leo O Hawai‘i, the University of Hawai‘i at Mānoa's student-driven newspaper.  This semester I made finally the transition from print to web.  Though I have never really had a focus in web development, I thought it wouldn't be too far of a leap to go from print to web.  Though it is a slow process, we've drafted a new layout for the website that we hope to have up and running in the next couple weeks.

Challenges
While creating a website in itself is a task, creating a news site has more restrictions.  There's a lot of research that you need to put in before you make a site.  Before you even draft out a page, it is good to know who you're users are:
  • What browsers are they viewing the page with?
  • What is their screen resolution?
  • What operating system are they using?
  • What do they want to out of your site?
You can use an application like Google Analytics to do the information gathering on your current site so you can make adjustments to server your users in the future.

What's in a page?
There are many things to take into account when creating the layout for your website.  But the most important thing is to server your users.  People come to your site for a reason, and it is your job to make it an easy and enjoyable experience.

"Keep it simple, Stupid!"
A well-known saying in the programming community, but it has many more applications than that.  You want a site that is easy to navigate with high affordability.  If people come to your site and leave within a few minutes because they couldn't find what they were looking for, the only thing your site accomplished was to wasting their time.

The Information Age
Websites are not static documents.  They can be updated on an hourly basis to provide the most up-to-date content for their users.  This is what makes news sites extremely effective in comparison to their printed counterparts.  When people view your web site they want the most recent information.

"The Good, the Bad and the Ugly"
College Publisher

Good: College Publisher
College Publisher provides hosting for many college newspapers across the nation.  Their home page has a very simple layout with easy a simple tabs for navigating the site.  The "What Can You Do Here" towards the middle of the page provide simple icons to grab attention and useful links to help new users discover what services the site provides.

Good: jQuery
jQuery
jQuery, like College Publisher, also provides a top bar for navigating the site.  It uses whitespace effectively to provide a very simple layout to forward you to four project sites.  They've decided to stick with an analogous color scheme: yellow, green and blue, which is very easy on the eyes and entertaining.





Bad: Yes English School
Yes English School
I remember seeing this site a few months ago, and I must say they made some improvements.  I know they're going for a very artistic layout, but their site overall is not very helpful.  Their logo is not very easy to read with the rainbow bullseye behind the text.  The cursive font they use for each section is not very easy to read.  On top of that their site does not offer much insight to what the lessons are like.  They only provide their prices.






Ugly: Evolution and the Nature of Science Institutes
Evolution and the Nature of Science Institutes
At first I thought I was looking at a page from ten years ago, but I see that it was recently updated it 2 days ago.  Not to mention the site takes about 24 scrolls to hit the bottom of the page.  On average you should hit the bottom of a page in about two to three scrolls at most.  No one is ever going to read to the bottom of the page in one sitting.

Friday, October 15, 2010

RoboHosting

This week we delved into the world of content management systems (CMS) and Subversion.   Although I've never used one for developing my own programs, it wasn't very hard to learn being used to downloading patches.  It's a nice change to get a glimpse of the development side for once.

Task 1: Download and install an SVN client.
I decided to use SmartSVN, a GUI for Subversion.  The installation process was very simple, and I can easily checkout the source files I want access to.
SmartSVN graphical user interface.
Task 2: Checkout/modify/commit an existing system.
The project we had to modify was robocode-pmj-dacruzer, a sample bot created by our professor to help us learn everything from automated builders (Apache Ant), automated quality assurance tools (Checkstyles, PMD, FindBugs), code coverage tools (JaCoCo), to CMS this week.

I was able to successfully import the project via SmartSVN, modify the documentation, and commit the changes.  I made sure to build and verify to the project both before and after making any changes to any of the files to avoid confusion if an error occurred during the process.

My change was very minor which involved inserting a line of documentation to better explain the function of the findbugs.build.xml file:

"Build fails if findbug detects an error."

Task 3: Create a new system hosted at Google Projects.
The the final task was to upload the most recent version of our robocode robots onto Google Code.  Like most of Google's products, setting up a project home was very simple following the online instructions.  You can explore my project home: robocode-agh-cakebot for a project description, source download, developer and user guides, as well as view any changes that have been made to the code.

Project Home: http://code.google.com/p/robocode-ahg-cakebot/

Friday, October 8, 2010

RoboTesting

A few weeks ago our class was exposed to a neat software development tool called Apache Ant.  I haven't really used automated builders in the past, but I like it thus far.  Along with our automated building software we were introduced to a few automated quality assurance tools: Checkstyle, PMD, and FindBugs which take care of catching various formatting violations (including missing Javadocs) which allows me to focus more on the code's logistics.

Testing
This week we focused on creating JUnit tests, and it was up to us to create test a six test cases that would adequately ensure the quality of our robots.  Along with JUnit we used a Java code coverage tool called JaCoCo which will check to see what lines of code are executed every time you run a program.  This helped a lot when testing my robot's evade() method.

Test Cases
Quality Tests
TestCakeBotAim:  My bot tracks enemy movement with its gun, this is a simple test which checks that the gun adjusts its heading appropriately when the enemy or my bot moves.  This is a basic black box test to ensure that the number that comes out of the method is the expected value depending on the input.


TestCakeBotFiring:  I implemented a method so that my bot can adjust it's power based on the distance to the enemy.  This test ensures that my bot is firing weaker shots on opponents that are further away, and stronger shots when they are closer.


TestCakeBotWall: A simple test that makes sure that my both changes its heading upon hitting a wall of the robocode battlefield.  The bot may not hit every wall in the test, but it is alright because as long as it can be proven to work on one wall it should apply to all others.

TestCakeBotEvade:  Depending on where my bot gets hit by a bullet it will change its heading by 45° into the shot.  The bot slightly favors turning right (as it will go that direction when hit from straight on).  This test case checks that the bot is turning the correct direction when hit by a bullet.  JaCoCo was especially helpful with this test case as I figured out that my bot would always turn right due to a logic error in my conditional statements.

Acceptance Tests
CakeBotVersusSittingDuck:  A very simple test against a bot that does nothing.
CakeBotVersusCrazy:  Pits my bot against a bot that performs random actions.

In both of these tests JUnit will run the bots in Robocode and check if my bot will win 10/10 battles.  If my bot happens to lose 1 match the test will fail.

Thoughts
This was quite a learning experience, as well as the most extensive testing I've performed on a single program.  There were a few modifications I had to perform on my robot's code to make some of the actions testable!  For instance my evade() and smartShot() methods had to be redesigned to return double.
On the other hand, I had some trouble designing the test that checked to make sure that the robot would change its heading when it ran into a wall.  Fortunately I was able to modify some code by our professor which originally checked if a bot visited certain locations on the battlefield in a match to instead test the heading of the bot as it approaches the sides of the battlefield.
The acceptance tests were the easiest tests since there isn't really any specific code that you have to test.  All that matters is that your bot wins (which isn't too hard when your bots are SittingDuck and Crazy.)
Testing for specific onEvent calls were the hardest to test.  Technically you can't call any of your robot's methods outside of its run() method, so I had to manually create my own events and populate it with the appropriate parameters to test a few of the robot's methods.

Overall, it was a fun project that.  My future projects will be designed with testing in mind so that I won't end up modifying many of my methods.

Here is the latest distribution file of my bot: robocode-ahg-cakebot.zip (requires Apache Ant v. 1.8.1)