The Adventures of Individual Assignmnt – Part 5 Finale

The Adventures of Individual Assignmnt – Part 5 Finale

Hello Globe! This is it. It’s the last time you’ll probably hear from me. (Thank God!)😛

This final post entails the review of a tool to assist developers in a team.
My choice of tool is: GitHub – A Version Control System that helps developers work collaboratively.
GitHub is widely used and recognised, with over a million users and over two million repositories.

ImageDoes this icon seem familiar?  It’s the Octocat! It represents github and social coding. In fact, github supports many languages from java, javascript to perl, C, C++ to php, there are a myriad of languages in public repositories – encompassing social coding to its peak.

Before we can into the technical details of the tool, lets first answer a few simple questions:

Briefly introduce the tool or technique:

1. What is it called?
GitHub

2. What is the primary purpose of the tool or the technique?
GitHub’s primary purpose is to create repositories for developers to share code and collaborate. Project management and code hosting is also an integral part of GitHub.

3. Where can the reader get it?

https://github.com/

Simply create a new account – it’s free!

4. What are alternative tools or techniques to achieve a similar purpose?

There are a plethora of alternatives, however the more popular ones include:

  • Bitbucket
  • Codeplane
  • Repository Hosting
  • Redmine

From your experience – review the tool

Git is locally enabled that is distributed so that connectivity doesn’t block work and doesn’t require a complicated server.

Version control for Git takes snapshots rather than storing the differences. This has been highlighted as a difference to other version control systems, making git the supposedly better system.

From the book, it informs us of the basic Git workflow entailing three steps.

1)      First, you make changes and modify the files in your working directory.

2)      Then, you stage the files i.e. adding snapshots of your modified files, ready to update to the current version in the next commit.

3)      Lastly, you perform the commit – and basically, the files that they are in the staging area are permanently and safely stored into your Git directory.

 Is the tool useful in achieving its primary purpose or are there better solutions available?

The tool is quite useful when developers would like to actively work on code together – because repositories are a great way to enable collaboration. You can also use GitHub to be social, in terms of connecting with others and contribute to their code. This is actively promoted in GitHub. Other solutions might be better if coding and working in a team is not your strong suite, for example Bitbucket is very user interfaced based. In fact, github is quite technical.

What knowledge is required to start using the tool?

Some coding knowledge will be helpful because the main purpose of github is to enable developers to collaboratively work together. In particular, working on the same file and saving it. Therefore, you can say that without any coding knowledge of any language, one will be reluctant to use github as other programs can maintain history and record changes.

  Is it a sharp learning curve? Is the help/documentation useful?

The learning curve is somewhat sharp. Due to the nature of version control software, it may be slightly different to, say a standard project management tool as github will take longer to adapt to. However, the amount of support available on GitHub will facilitate a swift learning experience.

As with most technical tools, experience is your best friend. Once you become familiar with Git, things will become second nature to you.

Were there any tutorials or help guides that you found useful?

 Yes, there is a plethora of help available to learn Git functions. From the start there is a step by step process to install and assists the user to getting started straight away. However, for some more sophisticated functions, the book, external links and reading from the intermediate and advanced githelp

Image

http://help.github.com/be-social/

There are even training provided by an instructor

https://github.com/training/free

There are videos and a diverse community to help you if you feel lost or confused.

From your experience would you use this tool in the future?

If I were to develop code and create an application or system while expanding my knowledge by following others– then definitely yes, I would use github in the future. Not only does it improve my skills to work collaboratively, but it provides me with more technical skills such that I can learn off other people’s code and work as a team – at the same time on the same file.

However, some teams that I may work with might not particularly enjoy using technical tools such as github and would prefer a tool that is simple and avoids additional coding. Or a separate tool from their built-in IDE plugin version control software.

In the end, it’s up to user preference – but I do recommend github – it’s the most popular open source hosting site for collaborative coding.

Give the reader instructions on how they can get started with the tool or technique (it may be useful to provide screen-shots).

ImageImage

Then to make life even easier github has created:

Image

http://windows.github.com/help.html

Make sure you provide any hints or tips that you have learnt from your experience.

Use the help and documentation available! It will work wonders.

When I first started installing github, I admit, I was pretty lost. Why? Because I wasn’t making attend to the instructions. But, what put me back on track was the wide range of help available from the git website. Also, what I found very useful were the features – immediately after I got github installed, I was able to create a wiki, and perform code review – these features will prove to be very useful to develop into an effective team.

Image

From my industrial placement, I found that wikis and issue tracking are significant tools/features that make business processes and understanding a lot easier. From my experience using github, I could easily draw the connections and physically see why enterprises utilise these tools widely.

You may wish to include a sample file that you have created.

Using my group assignment was a perfect sample to inspect and review the capabilities of github.

I found the user interface VERY easy to use and whereever changes were made, they immediately showed up.

ImageImage

In conclusion, I bid you all farewell and good luck.

The Adventures of Individual Assignment – Part 4

The Adventures of Individual Assignment – Part 4

Hello Star! The fourth round on our business application programming leads us towards a certain familiar topic – public toilets.

However, there’s a twist. Looking pretty and design principles are important – the Graphical User Interface (GUI) assignment extends our simple Toilet database to a fully-fledged mobile phone application with functionality accessed through a Command Line Interface.

Generally, user interface design principles fall under these six categories: Content Awareness, Layout, Minimal User Effort, User Experience, Consistency and Aesthetics.

The default Jframe labels, buttons and background are all very bland, hence a lot of thought is required to design a ToiletMap application that is easy-to-use.

Font, font size, buttons, text areas and fields are all obvious design elements that need to be considered for GUI. I have not discussed them in detail, however. I have increased the size of everything for all-thumbs users and the vision-impaired.

My primary concern in relation to usability was definitely layout. Immediately after dragging a swing control onto the frame, my mind goes into a state of frenzy. Asking a bunch of questions – where should I put it? Whether it was a label, a button or a text area, I had to first understand how my application should work and where would be the most logical position for it to be placed.

Usability is especially important for mobile phone applications. Describe what you have done to make your application easy-to-use, referencing design heuristics. Include screenshots.

The best way to describe is to do it, with accompanying screenshots.

I dedicated my home screen to be extremely simple, allowing anyone to instantly recognise what needs to be pressed for what they wanted to do. In this manner, I have brought content awareness of each button through the use of its larger size and an appropriate icon to help interpret each button.

Sometimes people don’t read and just press, therefore icons are there to enable minimal user effort as it assists in their cognitive elaboration of information. The effect on a user’s experience is affected by content and a structured persuasion process which is represented through the Elaboration Likelihood Model (ELM) framework.

Under this framework, the search for information can go through two routers, a central and a peripheral. For ToiletMap, users go take the peripheral router which is more subtle and requires low elaboration i.e. using pre-existing ideas to capture attention and elaborate information. In fact, this reflected my goal of using simple icons to represent the meaning and the functionality behind Add Toilet, Search by Location, Update etc… as well as Aesthetics😉

Similarly, the navigation bar displayed on every screen follows this format: Home, Nearest Toilet, Search Location and Add Toilet. By applying this consistency, it prevents users from being lost and provides comfort as there is always have the navigation buttons that will not change.

The simplest and most easy-to-use screen is: Find Nearest Toilet

All the user has to do is press the Find now button, and what appears is the nearest toilet.

Side Note: Although the back-end coding was a slight struggle due to the realisation that we needed to sort and compare distances of each Toilet in an ArrayList. A comparator class was implemented as advised by Sim which I think did have some positive impact in sorting my ArrayList of Toilets.

The Search and Update screen, has several functionalities built in without the user realising it. Although this may not necessarily be the best idea, it does enable minimal user effort with a structured layout.

The design thought behind this screen was quite complex: it begins with the user entering a Toilet ID, then if found, the fields below will populate with the correct information. Those fields can be edited and the user can press Update. Conversely, if the user would like to remove the toilet, the button is there as well.

I would rate: Functionality: 5/5 while User experience: 3.5/5

Search Toilet is similar to the above, except that it searches by Location instead of by ID. So it asks for a postcode and you can search, the information will be displayed in the Text Area or, you can search by the distance you are willing to travel, and that information will also be represented below.

This screen I am the least happy with, I think additional time would be needed for me to think of a better interface design, however functionality wise it works, and it is not that difficult to use.

I would rate: Functionality: 4/5 while User experience: 3/5

Finally, the Add toilet screen has an extra functionality, I added for improved ease of use. The preview Toilet button allows you to preview what the Toilet entry will look like, before you commit to the Add button. Unfortunately, I had an issue with deleting my default list model in my GUI, otherwise I would have replaced it with a Text Area, similar to how the Search results are displayed.

This screen also gets: Functionality: 4/5 while User experience: 3/5

In summation, I really enjoyed the design elements of this assignment, however I believe a significant amount of time was spent on the user interface which did not assist with the general workload of “life”. I just got too into it. Plus Diablo3. shh…

Code: http://dl.dropbox.com/u/30098542/z3376091%20-%20ToiletMap_GUI.zip

The Adventures of Individual Assignment – Part 3

Hello Planet! I think it is time to publish the third edition of the wonderful Adventures of 2605 Individual Assignment.

What does this chapter involve? Simply described in one word: TOILET

With the widespread use of smart phones and its growing integration of its utilities into mainstream/human society, the location-based toilet application is a good way to learn about application development.

Given that the Australian government is currently developing an iPhone app to search for public toilets, it reflects how the app development is very current. Hence, we will utilise our knowledge in java to create our own toilet Android toilet app.

What is new for this assignment is that we are utilising a toilet database, therefore a database connection is required and some SQL (query language) knowledge is involved.

I found that step 0 was the most important step, because understanding what the classes are doing and what they should do, make significant inroads towards the development and working functionality of the application.

Step 0: Understand

After reviewing the classes: EarthPoint, Toilet and ToiletMap, I have realised that ToiletMap is an interface that requests the user for information, and then performs some action specified in Toilet.

Toilet is a class that stores all the information for toilet, e.g. the ID, postcode, name etc by connecting to the database. The Toilet class has methods to add/edit/delete a toilet, additionally, methods to getToilets by ID and an arraylist of Toilets by postcode and by location.

Describe how you have minimized the amount of duplicate code when creating a connection to the database, running a query and closing the connection in your application.

 From lab 5 tutorials, we learned that when accessing a database, we need to open and close a connection in each method. Using the example from the lab – the insert and printTimetable methods required us to make a new connection every time. This does indeed create duplicate code throughout the application.

To my dismay, I utilised the same approach for the ToiletMap application.

Consequently, the drivers were loaded every time, connections were opened and closed every time and catching exceptions were included every time in the methods of Toilet class.

Each method needs to catch exceptions and I used this as an initiative for testing. When running ToiletMap methods for example, findToiletbyID, if the result says “Unable to load database driver”, we understand that we need to make sure the library packages are added.

Thorough unit testing was performed by utilising ToiletMap’s if statements in conjunction with Toilet’s exception printlns. This ensured that my code either working or not working.

The duplication of code for drivers, connections and catches could however be logically separated and implemented in another class. Similarly, preparing queries, statement.set and resultSet’s also reflects code duplication. A further understanding of database connectors and method writing is needed to fully implement a class that reduces code duplication significantly. More lab work and further readings required.

Although, there hasn’t been an extensive reduction of code duplication, for the purposes of learning database connectors with java, each of these duplicate code have been commented to reiterate the functionality and the use of opening, closing and catching exceptions.

However, I utilised a template for the add/edit/delete Toilets and thus reduces redundant code.

For the query themselves, there was little to no duplicate code when running a query. Each method required a different query because we expect different results.

Attempts were made to write the same query in a different way while retrieving the same results; this was successful, where the queries were similar.

In conclusion, this assignment has further encouraged me to work on creating an application. Mobile phone application development has always been an interest and I must say that creating an application for Android that uses real-life data and an interface, makes it a very possible goal in the future.

As for code duplication, I have attempted to minimise where possible however due to the limitations of my knowledge, I felt I was restricted to use the same method as per the lab activity. Recognition of duplicate code however was widely identified and a conceptual solution has been provided.

Java solution: http://dl.dropbox.com/u/30098542/z3376091%20-ToiletMap.zip

The Adventures of Individual Assignment – Part 2

Hello Earth! It’s that time again; where we resume our adventure of 2605 Individual Assignment. Actually it’s Part 2.

This time, we need to create a UML Diagram to represent library resources. The diagram has all the key fields and methods.

Since a library resource can be either book, magazine, CD, DVD etc. I decided to use the concept of inheritance to demonstrate parent and child classes and as a technique of reducing redundancy across all these classes.

Basically, inheritance is the ability of an object to inherit the data structure and the definitions of the classes above it; as extensions of other classes.

Some uses of inheritance include:

  • allows code reuse
  • avoiding code redundancy and duplication
    • i.e. simplifies the code
    • simplifies maintenance and extending

UML Diagram:

*abstract classes are shown by italics

Generalisations are relationships in OO modelling, and this has been represented by the solid arrow lines from the subclasses to the super classes. I believe the relationships between them are disjoint as there are no overlapping attributes with another subclass and supposedly have shown all subclasses to be are displayed (complete).

Abstract OR Final?

My super classes are all abstract classes because there is no need to create direct instances of Item, Print or Media but its descendants may have direct instances.

Basically, the subclasses are concrete classes which do have direct instances.
Also, in a sense all the subclasses: book, magazine, dvd etc, can all be final if you decide not to make any more subclasses underneath them.

In my subclasses, I only have methods to that get and set fields. Hence, there are no overriding methods from subclasses to superclasses; therefore I did not need to implement final. i.e. no overriding inheritance.

However, there is a chance for me to apply polymorphism, that is, the ability of an operation to be applied to many classes. In the dueDate method, we can calculate the dueDate for book or DVD items, using the same operation but calculated differently. Although this will introduce more methods at the subclass level, I decided to use if statements in my dueDate method in the Item class for the sake of simplicity. Hence,

the above method shows a fixed number of days added to the borrowed date for Print and else i.e. media. Alternatively I could’ve done the following:

In reality, polymorphism should be able to add for books, magazines and reference books separately for a particular duration instead of doing it using if statements.

***GregorianCalendar***
A major aspect of this assignment was understanding what GregorianCalendar is and what it does. Thoroughly reading the API and searching for methods to use helped significantly and simplified what I expected to be a very long method for dueDate.

Partial (but working) java solution: http://dl.dropbox.com/u/30098542/z3376091%20-%20OOLibrary.rar

The Adventures of Individual Assigment – Part 1

Hello World! Welcome to The Adventures of 2605 Individual Assignment – Part 1

It seems I have learnt a new concept in 2605, Test Driven Development (TDD), a core component of Xtreme Programming. To define TDD, it is another way to develop software where it has become increasingly popular. By using TDD methodology, you create tests that allow you to make small and simple increments to the overall design of your software. In other words, TDD is more like a process rather than a methodology, driving you towards your final goal.

To access the code:

STAGE 3: http://dl.dropbox.com/u/30098542/z3376091%20-%20Stage%203.rar

STAGE 5: http://dl.dropbox.com/u/30098542/z3376091%20-%20Stage%205.rar

Test-Driven Development is actually quite simple, but you need to remember the three steps involved:

1.       Write tests – Attempt to test a small part of the system

2.       Make the test work – Do whatever is necessary.

3.       Refactor – Eliminate duplication created in making the test work.

Image This is an iterative process because TDD continuously refactors your code and tests it until it meets requirements.

Sound good? It gets better! The benefits of TDD are vast but I will only mention the prominent ones I encountered, so the benefits are and not limited to:

Improved software design by reducing design complexity i.e. makes the code simpler
I found that writing out my CalculateMonthlyTotal method for Stage 3 was greatly assisted by what my test expected. Even when I moved on to stage 4 where the plans were needed, I felt that TDD did have an impact on my thought process in establishing the correct calculation method. That is to say, within my Record tests…

Image

…the assertEquals clearly focused my attention that “130” needs to be attained.

Image

Consequently I understood that I needed another if statement inside the arching-overlord if statement that determines the plan in order to calculate the total for rate 2 and 3
So I can say that TDD revealed a simple and small change that assisted in the overall creation of the CalculateMonthlyTotal method; improving my design.

Maintaining the code is much easier, as developers know when they have broken their code; in other words, there is a domino effect of unforeseen consequences when you make changes. This was clearly reflected during Stages 4 and 5.ImageAs I implemented the plan into my RecordTest class, my record and CarShareBookingsToBilling classes started to overflow in red underline. As mentioned before, TDD’s simple and incremental development is a benefit and it is a process that runs a constant regression test every time a change is made allowing you to respond to any significant issues that arise during your development.

However, I found that the hardest part of adopting TDD is the way I write code. It required me to change how I think about the development of the Car-booking system. In INFS1609, I learnt to code by writing out my main methods first then writing the tests rather than having the tests driving the design of the code.

Image
In fact, this is a limitation of TDD where the quality of your software/system design is reflected in the quality of your tests. i.e. if you have poor testing strategies, your system architecture will also be poorly designed.

ImageI have to admit that I needed to start writing the main method before I started to create my tests in order to visualise mentally what the requirements were. The reverse style of development was definitely a challenge and I gradually overcame this by returning back to the test class and focusing on writing the test. This became evident in Stages 3 and 4 where TDD strengths were clearly reflected and I managed to make solid and working progress on the assignment. Image

Despite this, readings have shown that this may be a limitation of TDD because having many passing tests promotes a false sense of security and approval of your system which may not necessarily be perfectly functional.  Image

However, in Stage 5 the TDD approach hindered my progress. This is largely due to my inability to clearly conceptualise how to update the system to perform multiple bookings per customer in the new system. To overcome this, I went through the following process:

Upon reflection, a mixture of both TDD and coding in my comfort zone from past experience are an honest representation of the strategy I used to tackle this assignment. The use of TDD definitely provided a practical way of developing code and forced me to think differently. In terms of value, the comparison of strengths and limitations are oddly balanced based on my experience. However, I would encourage readers to attempt TDD for the experience because I firmly believe that the application of TDD in the business world and its process would be an interesting way to approach life and decision making.

Image

Word Count: 800.

Sources:

http://javaboutique.internet.com/tutorials/tdd/

http://www.typemock.com/general-unit-testing-page/2009/9/11/test-driven-development-tdd.html

Lecture notes: Lecture 1 and 2.

Remedial tutorial examples – simple interest, Currency conversion

Assignment experience – from labs 1, 2, 3 and from home

Test Driven Development: A J2EE Example
by Russell Gold, Thomas Hammell and Tom Snyder
ISBN:  9781590593271
Apress   Copyright Thomas Hammell ©  2005 (296  pages)

Professional Test-Driven Development with C#: Developing Real World Applications with TDD
by   James Bender and  Jeff McWherter
ISBN:  9780470643204
John Wiley & Sons (US)   Copyright Wiley Publishing, Inc. ©  2011 (360  pages

  http://www.basilv.com/psd/blog/2009/test-driven-development-benefits-limitations-and-techniques

http://en.wikipedia.org/wiki/Test-driven_development

http://social.msdn.microsoft.com/Forums/en-US/architecturegeneral/thread/0893f9d2-fb5e-4172-8fd4-13d1b59b667f

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.
Follow

Get every new post delivered to your Inbox.