Sie sind auf Seite 1von 76

Philip Darnell Rapid Application Builder for the Android Device B.Sc.

Computer Science 25/03/2011

I certify that the material contained in this dissertation is my own work and does not contain unreferenced or unacknowledged material. I also warrant that the above statement applies to the implementation of the project and all associated documentation. Regarding the electronically submitted version of this submitted work, I consent to this being stored electronically and copied for assessment purposes, including the Departments use of plagiarism detection systems in order to check the integrity of assessed work. I agree to my dissertation being placed in the public domain, with my name explicitly included as the author of the work. Date: ............

Signed: ............

Abstract
Due to the Android operating system starting to grow at an outstanding rate, more and more people are using the Android devices. This means there will need to be more people creating applications to cope with the users demands. This is where my project comes in as I will be creating a rapid application builder that allows users to rapidly create applications with the use of reusable components that can be simply linked together with a couple of clicks of the mouse.

Working Documents: http://www.lancs.ac.uk/ug/darnell/homepage.htm

Contents
1. Introduction............................................................................................................................. 7 1.1 1.2 1.3 2. 2.1 Introduction ...................................................................................................................... 7 Project Aims ..................................................................................................................... 8 Overview of Report.......................................................................................................... 8 Research Undertaken...................................................................................................... 10 Android Software Development Kit ....................................................................... 10 Components ............................................................................................................ 10 Development with Reuse ........................................................................................ 10 Linking Components................................................................................................11 Visual Development Environment.......................................................................... 12

Background ........................................................................................................................... 10 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.3 2.4

Similar Systems.............................................................................................................. 13 Justification .................................................................................................................... 13 Summary ........................................................................................................................ 14 Stakeholders ................................................................................................................... 15 Requirements.................................................................................................................. 15 Functional ............................................................................................................... 15 Non-Functional ....................................................................................................... 15

3.

Design ................................................................................................................................... 15 3.1 3.2

3.2.1 3.2.2 3.3 3.4 3.6 3.7 3.8

Use Case Diagram.......................................................................................................... 16 Use Cases ....................................................................................................................... 17 User Interface Designs ................................................................................................... 22 Class Diagram ................................................................................................................ 23 Sequence diagrams......................................................................................................... 25 Add Component ...................................................................................................... 25 Link Components.................................................................................................... 26 Finish Application and Make it Reusable ............................................................... 27 Summary of the design ............................................................................................... 29

3.5 System Architecture ............................................................................................................ 21

3.8.1 3.8.2 3.8.3 3.9 3.10

Acceptance Tests ............................................................................................................ 28

4. Implementation ......................................................................................................................... 30 4.1 Overview of implementation .............................................................................................. 30 4.1.1 Changes from Design................................................................................................... 31 4

4.1.2 Problems Experienced ................................................................................................. 31 4.1.3 Extra Features .............................................................................................................. 32 4.2 Class Diagram..................................................................................................................... 33 4.3 Main Data Structures .......................................................................................................... 34 4.3.1 Component................................................................................................................... 34 4.3.2 Methods........................................................................................................................ 34 4.3.3 Links ............................................................................................................................ 34 4.4 Algorithms........................................................................................................................... 35 4.4.1 Adding the Links to the Output File ............................................................................ 35 4.4.2 Reading the Java File and Parsing the Methods .......................................................... 35 4.5 Summary ............................................................................................................................. 36 5. The system in operation/Process description ............................................................................ 37 5.1 Walkthrough of the system ................................................................................................. 37 5.2 Process Description............................................................................................................. 42 5.2.1 Adding Components and Linking Them...................................................................... 42 5.2.2 Linking Methods.......................................................................................................... 43 5.2.3 Creating the Android Application ................................................................................ 44 6. Testing / Evaluation .................................................................................................................. 45 6.1 How the System was Evaluated.......................................................................................... 45 6.2 How the Evaluation was Created........................................................................................ 45 6.3 Results................................................................................................................................. 45 6.3.1 Summary of evaluators findings in Appendix 2 ......................................................... 45 6.3.2 Summary of evaluators findings in Appendix 3 ......................................................... 46 6.3.3 Summary of evaluators findings in Appendix 4 ......................................................... 46 6.3.4 Summary of evaluators findings in Appendix 5 ......................................................... 46 6.3.5 My Own Evaluation..................................................................................................... 47 6.4 Important & Interesting Results.......................................................................................... 47 6.5 Summary ............................................................................................................................. 48 7. Conclusion ................................................................................................................................ 49 7.1 Review of Aims................................................................................................................... 49 7.1.1 Easy to Use Application Builder.................................................................................. 49 7.1.2 Allows the user to Create Android Applications.......................................................... 49 7.1.3 Allow Applications to be Created with Components................................................... 49 7.1.4 Easing Problems Creating Android Application .......................................................... 49 5

7.1.5 Turning Applications into Reusable Components ....................................................... 49 7.2 Done Anything Differently ................................................................................................. 50 7.3 Future Work ........................................................................................................................ 50 7.4 Summary ............................................................................................................................. 51 7.4.1 What I learnt ................................................................................................................ 51 7.4.2 Overview...................................................................................................................... 51 References..................................................................................................................................... 52 Appendix....................................................................................................................................... 53 Appendix 1: Thorough Testing Proof ....................................................................................... 53 Appendix 2: Evaluation Form 1................................................................................................ 61 Appendix 3: Evaluation Form 2................................................................................................ 64 Appendix 4: Evaluation Form 3................................................................................................ 65 Appendix 5: Evaluation Form 4................................................................................................ 67 Appendix 6: User Manual......................................................................................................... 69 Appendix 7: Proposal................................................................................................................ 70

1. Introduction
1.1 Introduction
The overall aim of my project is to create a visual application builder for the android mobile phone, allowing users to wire reusable components into usable applications. Speeding up and cutting the costs of creating applications in the Android platform. I believe that this project will be a success as there are a number of problems with current methods of creating Android applications. First, developing applications for the Android platform requires that developers learn a new programming language. The article on bizle shows that developers and development organisations may be reluctant to change [18]. The study shows that change can negatively affect people within a workplace and dramatic changes may have to be made in the organisation e.g. retraining staff to learn a new programming language, whereas with my system it could help minimise the negative impact of change by insulating developers from these problems. Secondly, the only way for people to develop an Android application is to write all the code out without using any components, this can be hard for someone who hasnt programmed in this language before. During the system implementation, I found there werent as many sources of help for Android programmers as there are for the more established programming languages such as java, C or C++. Thirdly, there are clear engineering and economic benefits to developing systems from reusable components, including reduced system testing (as the components will have been used before thus meaning they will have been tested already) and accelerated development (as the code has already been written, they just need linking together). To solve these problems I will be creating a rapid application builder with the use of reusable components, it will allow anyone with a limited programming knowledge to create their own applications and help them learn about the Android platform in the process. This will allow the user to have a fully functioning application in only a few clicks of the mouse, instead of having to write out the code thus saving the user time which can be better spent. Therefore helping the user same money which is the overall aim for any business. My project is worth doing as the Android application market is a new mobile market, with little support in rapid application development tools. Yet when undergoing research I discovered a few successful rapid application builders for other operating systems such as the iphone, meaning there is potentially a gap in the market. (www.gartner.com [1]) forecasts that Android will become the No. 2 worldwide mobile operating system in 2010 and challenge Symbian for No. 1 position by 2014. With Android in 2009 having 3.9% of the market share and then 2010 having 7

17.7% showing an outstanding rate of growth, meaning that there will be a lot of developers moving into the Android application market as more people start using them. And as stated earlier my project will help them learn how to program in Android and create quick applications. The project will be helpful to software developers with different programming backgrounds as it makes the creation of applications that would usually take hours to write, fast and easy (after getting used to the system users should be able to create applications in minutes). Programmers can add their own components meaning the component library will be forever growing and being kept up to date. This means that there will be a wide range of applications they can create. Only taking a one off payment, instead of paying for a professional developer to write the code, meaning its much cheaper.

1.2 Project Aims


The aims for this project are: Create a simple to use UML representation of components. These components can then be simply linked together with the use of their methods. Once the user is satisfied with the components and links they can then create a final android application with all the necessary files and data so it can be run on the emulator via eclipse. The reusable components will be split into four different categories (user interface, query, management and database).

1.3 Overview of Report


The report has been split up into several major sections including introduction, background, design, implementation, system in operation / process description, testing & evaluation and a conclusion. The introduction sets the scene for the reader by giving them a brief description of the problem, project aims and an overview of the report. The background section describes the research in reusable components and Android devices. It also looks into any rivalling software that might already be out there. Finally it ends with a justification of why I believe my system is worthwhile to create. The design section contains all the design decisions that I considered as part of the project. The main part of this section is the system architecture and class diagrams. The implementation section provides a brief description of how implementation went, any problems I encountered and any changes from the specification. I back all this up by comparing the class diagram of my actual system to the proposed class diagram in my design section and justify any alterations. Also included in the implementation section are my main data types and their functionality and a few algorithms that I am most proud of.

The system in operation section provides a walkthrough of the main aspects of the system showing what it is like to use. This is illustrated with the help of screenshots. The testing & evaluation describes the acceptance tests that I created in the design section. It also describes tests that I performed on the system and the process used to evaluate the system including the review questions and the suggested changes. The conclusion section takes a look back at my Introduction and reviews how well I believe things went. This section discusses any variations from the original specification and possible future work.

2. Background
2.1 Research Undertaken
Before starting my project I had to do some background reading to get a better knowledge of the Android system, software components, development with reuse and visual development environments. I provide a discussion of each of these knowledge areas next. 2.1.1 Android Software Development Kit

The research on the Android Software Development Kit mainly involved learning how to create applications. This wasnt too difficult as it is a very similar language to java [6]. Using the Google [16], Android website I was able to create my first simple helloworld application with ease. I then moved on to create harder applications such as a login page and a notebook which allowed a user to create, edit and delete notes [5]. The android application model is split up into four helpful component types. These are: Activity. Each component that has a user interface is controlled by an activity [10]. Service. When an application has been closed it still runs in the background, allowing applications to communicate [10]. Receiver. Has a method that runs when a message is sent [10]. A receiver therefore is what the component requires for it to function correctly which the component calls from the other component it is linked to. Provider. Has methods which query or update the data in the provider [10] A provider is what the component has to provide, this method is called by another components receiver method, thus creating a link between the two components.

The Receiver and Provider are very relevant to my project as these components allow for my components to communicate with each other and be linked together. 2.1.2 Components

Prior to this project, I already had brief knowledge of components. I knew a component was basically a class that hid its implementation behind a well-defined interface [4]. However, a more formal definition, defines a software component as software element that conforms to a component model and is composed without modification according to a component standard [4]. This is useful as it means that components are subject to third part composition and can be used by other programmers. This led me onto my next piece of research, which was software development with reuse. 2.1.3 Development with Reuse

Development with reuse was a new aspect to me, as I had never come across it in my two previous years of studies. After reading the book Component-Based Software Engineering [4], I quickly learnt that it is basically making a component that then can be reused by other programmers. Development with reuse allows the user to create applications without actually 10

writing their own code as they are able to use other developers components. There are obviously many benefits of doing this, firstly the user is able to create complex applications using complex components that otherwise they might not have had the ability to write out themselves. Furthermore it allows the use of code that might have been programmed by a specialist, giving you a higher quality of code. Finally as the name of my project suggests rapid application builder it is much quicker developing with reusable components over writing the code out. After putting a bit of research into development with reuse I was able to find a few good examples of this: Java API. The java API contains all the components that can be used to code in java. A good example of this is if you are creating a GUI you will need to import the swing components so you are able to reuse them. Without this you would have to yourself code all the methods that when using the java API you can just do in a couple of lines of code [17]. Interface Builder. This is an application for iphone developers making it easier to build interfaces with the use of components linked together, you can see the actual interface you are designing in an example window. Due to the success this product has it suggests there is an opening in the market for my product [19].

I quickly realised that it might be possible to represent my application builder visualisation using UML component notation. Each component would be associated with underlying code and linked by a receiver and a provider method. I also realised that I would need some kind of Application Programming Interface (API), which is a way of showing the user the public methods (return type, parameters and name) that are offered from the component to the user. So they are easily able to see what it has to put forward, although the private methods (that the user cannot access) are kept hidden [12], as some components are too complex for a user to understand by just looking at them [14]. 2.1.4 Linking Components

After learning about components with reuse I decided to research how I would actually link these components to compose an application. I discovered that there are 3 main types of composition [11], these are: Sequential composition. In this type of composition, the components are executed in a sequence. Meaning that they are executed in the order they are initiated. Hierarchical composition. A component calls another components provides interface with one of the requires interface it provides, this is the linking I will be concentrating on the most. Example shown in Figure 2.1. Additive composition. The components are put together to create one new component, this is the type of composition that will be used to turn the users applications which will be made up of many components into one reusable component. Figure 2.1: Example component link [13] 11

I also came to the conclusion that some components will not be able to be linked together as they will not be compatible. This is down to three main reasons that I need to make sure are handled sufficiently, these are [11]: 2.1.5 Parameters incompatibility Some components methods will not have the same parameter types to be linked Operation incompatibility Names of the operations in the components are different. Operation incompleteness The provides interface of the component does not provide the requires interface with all the correct parameters. Visual Development Environment

Although my project is specific to android the GUI used for developing the application would be very similar to current products out there, so I decided to do some research on the best approach to tackle this. The first system I studied was for the construction of components in a visual editor [14]. The example used in this article is HotAgent, where components are connected together (like in my system) in Figure 2.2 It shows a print screen of this program running. As you can see in this screen dump it is very clear to see a UML diagram with the components on it and below two lists that include the components to be added to the list. This is very clear to the user and a good example.

Figure 2.2: Print screen of HotAgent [14]

12

The second project I studied was a project called GATE which is a framework and graphical development environment which enables users to develop and deploy language engineering components [15]. Here it mentions that the functionality of linking the components should all be hidden behind the Visual Development Environment to make it easier for the user to understand. Therefore it should be a visual representation of the component that the user sees, but they should not be able to see how it all works [15].

2.2 Similar Systems


After searching the internet I did find one rivalling system this is by a company called www.mobiforms.com [2] although to buy it you need to pay 99, and it is only for the creation of business applications e.g. stock control. Yet I believe that once developers have started using my application which would be available for a lot less than 99 they will add their own reusable components thus making my component library a lot more advanced. Therefore it will have a minimal effect on my product as my product is aimed at a wider scope of customers because of the extra features included such as adding your own components. Apart from this there was no other competition, meaning they are stuck with the only other method of writing the code out. Or using other peoples code but this suggests that they are going to need to know how the code works, meaning it can be quite hard to understand for some people.

2.3 Justification
I will be creating the rapid application builder for Android applications over another operating system because it is relatively new so there is little competition and will make it easier for people starting out programming applications. My project will be coded in java as this is my strongest programming language and with the use of swing components I believe it to be the best for creating user interfaces. It is also very similar to the Android language. I decided to use components with reuse because it has increased dependability as reused software has been tried and tested, therefore all the faults should have been fixed. Reduced process risk, as when a company uses my application builder they know how much they are spending as its a fixed cost. Whereas if they were writing the code things could go wrong making the costs go up. If it is a special piece component that is hard to program, then it means it only needs to be programmed once then can be reused. Finally it makes it a lot quicker / easier for other programmers to create their own applications, in fact it could quite easily be possible for a non programmer to create a simple program using my system [3]. Although on the other hand, there are some problems with components with reuse. These are that some programmers may not like the fact they are using someone elses code, this is known as Not invented here syndrome. It could potentially lead to increased maintenance costs for the end users as the source code is unavailable. Finally it may be hard to understand how the component works, although to counter this I will add comments to the components code which will be can be accessed in my system by the user to give them a better understanding [3]. Overall I believe that the pros majorly outweigh the cons meaning a Rapid application builder for an Android device, will be very successful as it is aimed at a wide market and components 13

with reuse allow applications to be created with ease.

2.4 Summary
In this section I took you through what I had to learn to prepare myself to start designing my system, the main thing I had to really learn about was components with reuse as my knowledge on this was very limited I now feel that I know enough to tackle to project. I then did some further research on the level of competition there is within the market, this was followed by a brief justification on why my project is therefore worthwhile. This will now be followed by the design.

14

3. Design
3.1 Stakeholders
To fully understand what kind of program I am to create I firstly need to figure out who the stakeholders of the system are. These are people that have any kind of interest in the project. Therefore the stakeholders are: Android application developers. The end user of the developed applications. Programmers.

3.2 Requirements
3.2.1 3.2.2 Functional The system shall make it easier for developers to create applications. The system shall be able to cope with changes to the database. The system shall stop the user from trying to create links between components that arent compatible. The system shall allow components to be linked together. The system shall create a working Android application when finished. The system shall let the developer create their own reusable components. The system shall allow components to be linked together by their methods. The system shall not allow two incompatible methods be linked together. The system shall allow instances of unfinished projects be saved and reloaded at a later date. The system shall allow links to be deleted in case two methods are accidently linked. Non-Functional The system shall be working 99% of the time. The system shall be easy to use. The system shall come with easy to follow instructions to help users quickly adapt to using components with reuse. 15

3.3 Use Case Diagram

Figure 3.1: Use case diagram I then went on to do the use cases for Figure 3.1:

16

3.4 Use Cases


Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario: Create application Rapid Application Builder Developer Database The developer opens the program and starts to create an application Rapid application builder is open 1. Pop up window opens where the user enters the name of the file. 2. Verifies that the filename is okay to use and closes the pop up window. 3. The main component panel is created blank so the users required components can be added. 4. The scroll panel is populated with available components for the user to select. 2a. The developer enters an invalid name. 2b. Error message is displayed till user enters a valid name. 1. The database must be fully up to date in case any new components have been added. A project has been started and is waiting for the user to add some components. Table 3.1: Use case table for Create application Add component Rapid Application Builder Developer Database The developer adds components to be used in the application. An application has been created. 1. The developer chooses what kind of component they require from the left hand side e.g. validation. 2. Once clicked a list of components will be displayed. 3. The developer then clicks the desired component. 4. The component is requested from the database. 5. It is then added to component panel. 2a. The developer has clicked the wrong tab. 2b. The correct tab is clicked. 4a. The component cannot be found in the database. 4b. Message is displayed saying component cannot be found. 4c. Go back to step 3 and select another component. 4. The database must be fully up to date in case any new components have been added. The selected components have been added to the component panel, waiting for a link to be established. Table 3.2: Use case table showing Add component

Alternatives: Exceptions:

Post conditions:

Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario:

Alternatives:

Exceptions:

Post conditions:

17

Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario:

Get component Rapid Application Builder Database Developer The developer has chosen a component to add to the application so needs to be retrieved from the database. A component has been selected 1. A request is made to the database. 2. The database searches for the required component. 3. Once found the component is returned to the system. 4. The component is then stored on the developers computer in a desired location. 2a. The database cannot find the component. 2b. Error message is displayed. 2. The database must be fully up to date in case any new components have been added. The component is ready to be used by the developer. Table 3.3: Use case table showing Get component

Alternatives: Exceptions:

Post conditions:

Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario:

Alternatives:

Exceptions: Post conditions:

Link components Rapid Application Builder Developer The developer creates a link between two components. There needs to be two or more components added to the component panel 1. The developer clicks on the first component which selects the component. 2. The second component is then clicked which establishes the link. A line is then drawn between the two components. 3. A menu then opens with the possible links that can be used. 4. The developer chooses the required link / links. 2a. A component has been clicked that cannot link with the other. 2b. No line is drawn and goes back to step 1. Two components have now been linked together. Table 3.4: Use case table showing Link components'

18

Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario:

Alternatives:

Exceptions: Post conditions:

Finish application Rapid Application Builder Developer The required code is created so that it can be run on an Android device. All components have been added and all the links have been established. 1. The developer clicks the finish project button. 2. A drop down menu is displayed, the user then fills in the required fields. 3. A folder is created with the code inside. 2a. There are no links been established. 2b. A message is displayed warning the developer. 2c. The developer makes the changes and tries step 1 again. A final project has been created and is waiting to be run. Table 3.5: Use case table showing Finish application

Create reusable component Rapid Application Builder Developer The application created by the developer is turned into a reusable component An application has been finished and the developer is Preconditions: willing to share it. 1. The developer clicks the create reusable Main Success Scenario: component button. 2. This then turns the application into a component. 3. The component is added to the database and is ready to be used by other developers. Alternatives: Exceptions: The final application has now been turned into a reusable Post conditions: component for other developers to use. Table 3.6: Use case table showing Create reusable component Use Case Name: Scope: Primary Actor: Secondary Actors: Summary:

19

Use Case Name: Scope: Primary Actor: Secondary Actors: Summary: Preconditions: Main Success Scenario:

Alternatives: Exceptions: Post conditions:

Run application Rapid Application Builder End user The application is run. The application has been added to an Android device. 1. The end user clicks the icon to run the application. 2. The Android device loads the application ready for the end user to start using. 2a. The application cannot run. 2b. The developer needs to create another application. The application has been successfully run. Table 3.7: Use case table showing Run application

20

3.5 System Architecture


I decided that client-server architecture would suit my project. As this allows all of the program aspects to be running on the individual clients yet the database will be stored on the server. This makes it easier for updates to the database as there is only one database to update, whereas if the database was stored on the client machines it would need to be updated on all the individual machines. Also the program is run on the client as this allows the server to focus on database requests, thus making requests to the database much quicker.

User Interface and Component Visualisation Client Component management Code generator

Server

Component repository

Figure 3.2: System Architecture As shown in Figure 3.2 my system architecture will have four main components. I will now give a brief description on each component and their main functionality: User Interface and Component Visualisation. Contains any of the graphical user interface e.g. component panel. Is linked to the component management so it is able to retrieve information to add the component to the visualisation. Component management. Takes care of any of the component requests, therefore linked to all the other components. Code generator. Generates the required code and files to run the Android application. Is linked with the component management where it will retrieve the code and links to be used. Component repository. Storage of all the components and the required data. Is linked to the component management which allows for files to be taken out for reuse. 21

3.6 User Interface Designs


Following on from the Architecture in Figure 3.2, I mentioned a User interface, consequently during my design I came up with two diagrams showing how I wish my user interface to look:
List of different components UML component diagram

Tabs to select relevant area

Figure 3.3: User interface diagram


Requires Validation Provides

Figure 3.4: component diagram [4] I believe that Figure 3.3 shows the best way to visually represent my system. This allows the user to easily choose the component they want as they are sorted into the different categories and to change from one category to another you simply just click the tab you want. Once you have chosen the required component from the list, a component box (as shown above) is added to the UML component diagram. Where it will have a requires interface which are the methods the component needs to function correctly and a provides interface which are the methods it provides to other components. To link two components you simply click the component box you want to be the provider first. Then click the box you want to provide the methods from. A pop up will appear listing the methods for both components, you then simply drag from and to the methods you want to link.

22

3.7 Class Diagram

Figure 3.5: Class diagram

23

Descriptions of the classes in Figure 3.5: Component_display. Will start off as a blank canvas, where a graphical representation of the component will be added when a component is used. These components will then be connected with a simple line once a link is established. List_comps. Will be a tabbed list that has 4 categories, these will be Interface, Query, Management and Database. Once one of the tabs is clicked a query is sent to the database to retrieve a list of the components in that category, this list is then displayed to the user, when a component is clicked it will then be added to the component_display. Main_display. The main display will simply bring the Component_Display, List_comps and the menu bars all together in one single Window. Links_display. Once two components have been linked, an instance of the Links_display will open this will have each component on either side of the window, with the list of their methods. The user will then click the receiver method they require and drag it across to the provider method, therefore drawing a line and creating a link between the two methods. Adding to the Method_Links. Comp_Link. When two components are linked this class is called, here it checks to make sure the two components are compatibility, if not no link is established, if so they are linked. And the Link is added to the Comp_Links array. Comp_Links. Is an array of all the component links, so when creating the output file it knows which components are linked. Method_Link. When a method link is being created in the Links_display window this class is called to make sure the link is valid. E.g. it is taking the correct type of provider method. It is then added to the Method_Links array. Method_Links. Is an array of all the method links, so when creating the output file it knows which methods are linked. Output_file. Creates all the necessary output files / data to be able to create the android files, this includes files such as the android_manifest.xml. Database. I will be using a database to store the components as this makes it easier for components to be shared and updated. Therefore this class is used to make queries to the database e.g. get a component.

24

3.8 Sequence diagrams


3.8.1 Add Component

Figure 3.5: Sequence diagram showing Add component

25

3.8.2

Link Components

Figure 3.6: Sequence diagram showing Add component

26

3.8.3

Finish Application and Make it Reusable

Figure 3.7: Sequence diagram showing Finish application and make it reusable 27

3.9 Acceptance Tests


These tests have been created for the use of the evaluators once my implementation has been completed: Test no. Whats been tested
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Opening the rapid application builder Creating a new project Trying to create a project with an existing name Opening an existing project Adding a component Linking two compatible components Trying to link two incompatible components Moving components Clicking on different tabs on the component list Saving a project Enter the info. Enter incorrect info. Running the Android application Selecting a link between two components Trying to open the methods window for two unlinked components Linking two methods

What should happen


It should open properly and greet the user with a new project / open project screen. A blank project should open A warning message is shown asking you to choose a different name. The project will open fine and all the components will be in the same place as when you last left them. A component is selected from the left hand side and when clicked it will appear on the component panel. When both boxes have been clicked a line appears between the two boxes showing that the link has been successful. After both boxes have been clicked this time it will not do anything and no link will have been established. When the mouse is dragged the component box will move with it, any lines attached will stay attached. Once the tab has been clicked the list will then change to components that come under that category. A pop up window will appear asking for info. on the Android application. An eclipse project will be created so can be tested by the Android emulator. A pop up window will appear informing you of your mistakes. It will run fine with no errors.

A window will appear showing the methods of both components.

15 16

Nothing will happen. If correctly linked a line will be drawn between the two to show they have been linked.

28

17 18

Linking two incompatible methods Create new project

No line is drawn and nothing happens. Should ask if you want to save your current project and then create an empty project. Table 3:8: Acceptance tests

3.10

Summary of the design

In this section I went through how I intend my program to function by representing it in the form of diagrams. I will now move onto implement my program. I expect this to take me a few weeks and my next part of the report will explain how I implemented it and show the main parts of my system in more detail.

29

4. Implementation
4.1 Overview of implementation
After completing the design of my product it was time to actually move on to implementing it. Overall I believe this was quite successful and in this chapter I will go on to talk about what I actually implemented, how I believe it went, any problems / bugs I encountered, what was the hardest part of implementation, anything I would have liked to add and why I didnt add these things.

Figure 4.1: Print screen of the main screen Figure 4.1 shows, that I actually implemented the layout the same as I wanted to in the design process. With the component list on the left hand side with the tabs to give you the option of choosing different categories, and the main component panel where the components will be situated once selected. Although I did slightly change the way linking components worked. Instead of having the ball and holder notation I was aiming for (as shown in Figure 3.4) I simply went for a single line. This gave me the ability to have the one link for the component yet allowed the two components to have many method links within. I believe this to be a better option, as mentioned it stops my UML diagram looking messy with lots of lines linking between two components. Also with the use of a pop up window it allows you to view all the different methods offered by each component. An example of this is shown in Figure 4.2:

30

Figure 4.2: Two linked components Overall I believe that the implementation stage of my project has been very successful, I got all the main aspect of the system done. This included making a user friendly application builder and the components to go with it. I started off just making a few simple components that would link an interface and a database together to create a simple login page. Then when I realised I had more time left on the implementation stage I moved on to create some more advanced components. 4.1.1 Changes from Design In the end I changed my mind about having a database for the components to be stored on, as I believe for the current amount of components there are, it wouldnt be worthwhile the user having to request the components from a server database. Instead it would be much quicker to access them if they are stored locally in files on their own machine. Yet when new components are added the application can be updated online and the new components added to their correct destinations with ease. If the system was too be a success with users adding plenty of their own components, it would be beneficial to store the components on a server in a database as this will ease storage space on local machines and adding new components. 4.1.2 Problems Experienced While programming I didnt experience too many main problems, one problem I did have was getting to grips with components and how they would work within the Android programming language (as its a new language to me). But I was getting this problem as I was trying to start with a big application straight away. Therefore instead I decided to go back to basics and start with making a simple helloworld application that was componentised. This then allowed for me to work my way up to a bigger program and tackle it successfully. Secondly, I spent a lot of time struggling with Activities within the Android operating system, but after searching the internet for help I finally realised that it was because I wasnt including them in the android_manifest.xml file thus making my program crash when calling the non-existent Activity. The final problem I had was in regards to actually linking components, as components are new to me it, although after reading up about them and researching them on the internet I realised they are linked by the public methods they have to offer. The hardest part I found was creating the main output java file, because I needed to make sure all the links where dealt with correctly. And because all the links are not set up in the correct order it needed to loop through the array of links, make sure it was getting the correct parameters for the method before adding to the file. Otherwise all the method calls would be incorrect. Another part I found quite tricky was creating the actual Android application, as my aim was to make it so 31

the user would simply open up eclipse, and the Android application would be there in their workspace. Unfortunately, after researching this and trying to change a lot of files I had to admit defeat and make it so the user has to import the application instead. This still was no simple feat as I still had to create all the folders and files necessary. I was able to make this simpler by going into eclipse creating an Android application, looking at all the folders that I needed, and any generic files meaning I was able to copy them into the correct place when creating my Android applications. 4.1.3 Extra Features If I were to have had more time to implement my project I would have liked to add many more components to turn into applications. But due to time constraints I prioritised my work, with getting my system to function correctly at the top of the list and then components coming after this as the main aim of my project was to build the actual rapid application builder. Furthermore, I would hope other users will eventually start creating their own components for the system. Finally if I was ever to go back to this system and modify it I would like to make it so you can create applications on multiple platforms, such as the iphone etc. but because the iphone operating system is written in objective C I believe that this would have been too much work for my project.

32

4.2 Class Diagram


As with any system that is design when you actually come to implement it you start to realise designed that some of the design ideas could be improved. This happened in my system therefore . meaning I had to change my class diagram, so after finishing implementing this is the class diagram I ended up with:

Figure 4.3: Class Diagram 2 As shown in Figure 4.3 I dropped the idea of a database to store the components and made it so the tabbedPanel just uses populate() which looks in the four folders I created and any files it 33

finds in there it adds to the selected tab. Secondly I changed the way I was planning on handling links. Instead each component stores the links it has. Therefore when someone tries to do a methodLink it checks each component to make sure they are linked together. I also changed the way the system gets methods out of a component, instead it reads the file gets all the methods out and stores them in the component instance. Finally when methods are linked they are all stored in an array of MethodLinks and read and sorted by the outputFile.

4.3 Main Data Structures


I had quite a few main data structures to make it so I was able to store various pieces of data together, such as components, links and method links. 4.3.1 Component This is where I held all the important information about the components. The variables that it contained were the component name, x and y coordinates on the component panel (for when it was moved), type of component (for use when creating the output files so it knew which folders to search etc.), an arraylist of components (so that it knew which other components it was linked to its self) and finally an array of methods (this was a separate data structure). I used this data structure as it makes handling components much easier than having to go to different places to get information about the component, and you can access it all at the instance of the component. 4.3.2 Methods This held all the information of the methods, so that you can just create an array and store that in the instance of the component. In the method data structure it gets populated by the component when initiated it calls the readjava class which reads through the file getting the methods out, the methods are then split into three sections. These sections are the method name, return type and parameters. These are then stored in the method data structure. 4.3.3 Links This held all the information of all the links, so that they can be stored in an array and be accessed easily when creating the output file. So each link holds the provider component, receiver component, the provider method and receiver method.

34

4.4 Algorithms
In this section I will show a few algorithms showing the functions I am most proud of: 4.4.1 Adding the Links to the Output File For each item in the links array do, params links[i].parameters; For the length of params do, If params.charAt == , then noOfParams++ If noOfParams == 1 then Write(recieverName + . + recieverMethodName + ( + providerName + . + providerMethodName + ());) Else if noOfParams > 1 then Write(recieverName + . + recieverMethodName + ( + providerName + . + providerMethodName + (),) For y<noOfParams do, If links[i].recieverMethod == links[y].recieverMethod then Write(providerName + . + providerMethodName + ());) In this method it loops through all the links and checks how many parameters that method takes. If it takes one then it simply just writes the link out in the correct format, if it has more than one it has to link through the extra amount and put them in the correct format. 4.4.2 Reading the Java File and Parsing the Methods In bufferedReader(pathToComponent) While readLine() != null do, If read.contains(public) For read length do, If read.charAt == then Get next String ReturnType String If read.charAt == Get next String Name String If read.charAt == ( Get next String Parameters String Method[] = new methods(name, returnType, parameters) This method takes the file and reads through it, it then checks to see if the line contains public, if it does it then gets the next word which will be the return type and saves it as a string. It then gets the next word which is the name and saves that in a String. It then gets the parameters after the (. Finally it then saves them all in a method instance. 35

4.5 Summary
I believe that implementing went very well, I was able to get all the features done that I aspired to and with plenty of time left to get my system thoroughly tested. I will now move onto the testing and evaluation section of the project. I will give my system to 4 evaluators all with different experiences and skills, they will check through it to try and find errors.

36

5. The system in operation/Process description


5.1 Walkthrough of the system
In this section I will create a step by step walkthrough of how my system works and how the user interacts with it: Figure 5.1 shows what the user is greeted by when running the program.

Figure 5.1: Opening screen They then have the ability to either choose a component from the left hand side or if they do not require a component from that category they can simply change the category by clicking the tab they want. E.g. Database. This example is shown in Figure 5.2.

Figure 5.2: Changing tabs 37

So once the component they require has been clicked it shows a graphical representation of the component in the component UML display. Here they can add all the components they require so I will simply add the Interface Loginpage and the Database LoginDbAdapter, this is shown in Figure 5.3:

Figure 5.3: Adding components You can then link the components you require to be linked. This is done by clicking on one component then on the other, this will then draw a line between them and establish a link:

Figure 5.4: Linking components 38

Once a link has been created you are able to access the methods link page (Figure 5.5) by holding Ctrl and clicking on the two components you want:

Figure 5.5: Method display You can now right click on a method to bring up a description about it in the right hand side box (Figure 5.6), or drag from the requiring method to the providing method to create a link (Figure 5.7):

Figure 5.6: Method description

Figure 5.7: Create a link 39

When you have finally created all the links you require, you can then finalise your application by turning it into an Android application. This is where you set your application name, package and SDK target (Figure 5.8). This subsequently creates your application in the workspace (Figure 5.9 and Figure 5.10):

Figure 5.8: Save a project

Figure 5.9: The main folder that has been created

Figure 5.10: The contents of the folder in Figure 5.9

40

Figure 5.11 shows the actual generated code:

Figure 5.11: Generated code Finally you import the application into eclipse and run it on the Android emulator or device as shown in Figure 5.12:

Figure 5.12: Application running in the Android emulator 41

5.2 Process Description


5.2.1 Adding Components and Linking Them Firstly the main process my system has to undertake is the ability to add components to the UML diagram and then the ability to link the two components together. So the categories are populated by searching in the four different folders, Interface, Query, Management and Database. Inside each folder is a sub folder that contains all the relevant information needed for that component. This includes the string.xml and the layout.xml these are needed when creating the android application. So when the user chooses their component an instance of the component class is created and when linked with another component there is an array which stores the links in this instance. Figure 5.13 shows this.

Figure 5.13: Process diagram for adding components and linking them

42

5.2.2 Linking Methods When linking methods a separate window opens up with the lists of the public methods in both components on either side of the screen. The methods are retrieved by using the readjava class, this parses the .java files stored in the component folder of the selected components. Any public method it gets the return type, method name and parameters taken. The user simply drags across from the receiver to the provider, if the link is valid then it is stored in an array of method link instances. This contains the provider name, the provider method, the receiver name and receiver method. This can then be called when creating the final android application. Figure 5.14 shows this.

Figure 5.14: Process diagram for linking methods

43

5.2.3 Creating the Android Application This part of the application doesnt really involve much user interaction as this is where it creates all the files / folders needed for an application to be run on an Android device. The main files being the android_manifest.xml, putting the Layout .xml files in the correct folder after creating them by copying the code from the component folder, also combining all the String.xml files from the components into one String.xml file. Putting all the java files into the src folder and creating the main part of the program where all the components are linked together. Figure 5.15 shows this.

Figure 5.15: Process diagram for creating an android app

44

6. Testing / Evaluation
6.1 How the System was Evaluated
The system was evaluated with a form of black box testing [20] which is where the user has no knowledge of the code and only cares about the input they enter and the output they receive. I achieved this by firstly completing the implementation of the first version, this was sent off with 20 test cases to Matthew Darnell, where he was able to make some very helpful suggestions and came upon some errors. This meant I was able to go back to my code and make the changes he suggested and eradicate any errors he found. I did this with 3 other evaluators who filled in the evaluation forms and again made their suggestions. Fortunately no more errors were found, however I was still getting some recommendations on the user interface side. After the evaluators had finished I had my final system created. Finally the system was checked by myself with the use of white box testing as this requires specific knowledge of the programming code, which I have [21]. Using a combination of both black box and white box testing I was able to complete a very thorough test.

6.2 How the Evaluation was Created


It was quite simple to create my evaluation. I started off by setting up some test cases when doing my design. After finishing my implementation I realised I few tests were not applicable or needed altering as my specification had slightly changed. Instead of just sending my system out to my four evaluators at the same time I decided to rank them on their experience / skills. With the least experienced first suggesting their changes getting rid of basic problems (this was actually not the case as my first tester got rid of all the errors) and then moving up. Meaning the most experienced would be able to mainly concentrate on getting rid of harder to find errors. I decided to use black box testing as it meant I could put the evalutors in the position of the potential end users. Meaning they only cared about the end results and where not concerned with how the results were created.

6.3 Results
Below are the four evaluation forms I sent out. After I received each evaluators feedback I was able to make the changes recommended or explain why these changes werent made, these are summarised below: 6.3.1 Summary of evaluators findings in Appendix 2 After getting the results back from the first evaluator I was able to start making some changes on my system according to their findings. The first improvement I started to implement was allowing the user to save projects as the evaluator said this would a good feature. I did this by saving the instance of the componentPanel and then loading it back up when you want to use the instance again. (This will now be a new test added for the next evaluators). I also changed the way components were added to the component panel, now instead of each component being given the same coordinates when added they get random unique coordinates on the panel. Another change was warning the user about overwriting existing projects, a warn now appears saying Filename Taken! when a user enters a taken filename. One thing I disagree with the 45

evaluator about is the linking of two incompatible components, because when two components are linked together there is actually no link established till methods have been linked. And as they are just components there is no way of telling if they can be linked or not. Therefore I believe the current version is fine for this. Secondly, when he says about importing the application into eclipse easier I have tried this and because the data for the workspace in eclipse is saved as a batch file I am unfortunately unable to change it. The next two evaluation forms where sent off at the same time: 6.3.2 Summary of evaluators findings in Appendix 3 William Harding liked the fact a link could be deleted in case he made a mistake. A vast improvement has been made from the first evaluator with the only negative comment being made being about pressing ctrl and clicking the two components to open the method panel instead of just clicking the line. Changes may be made to this depending what the other two evaluators say, but with this being just a minor change it will stay the same for now. 6.3.3 Summary of evaluators findings in Appendix 4 Again the only problems that keep cropping up are the lack of error messages, now I have had three testers all come up with the same suggestions. I decided it would be a worthwhile change so will now implement a function that deals with errors, this function will open a new window with the error message displayed. I still am not convinced that clicking the line is the best way to link components, as clicking both components lets the user decide what sides they want the components. Also if the UML diagram is cluttered with lots of links clicking a line could get confusing. I also strongly agree with the changing colour of selected methods and will 100% be implementing this. Again I liked the suggestion to order the File menu list to contain the items in a more logical order. 6.3.4 Summary of evaluators findings in Appendix 5 This was my final evaluation form that was sent out. Thankfully no more errors where found and Adam was the only tester who did not try and click the link to open a link and liked the use of ctrl after I explained to him why I did it this way. He also liked my new feature of changing the text box of the first clicked component to be highlighted red (as suggested by David), so you can remember which method you clicked first.

46

6.3.5 My Own Evaluation I decided after my evaluators had finished their evaluations and I had eradicated all the errors. I would then get my final version of the system and test the main aspects of the system myself showing detailed print screens of each step I took: Aspect being evaluated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Opening the rapid application builder Opening an existing project Adding a component Linking two compatible components Selecting a link between two components Trying to open the methods window for two unlinked components Linking two methods Linking two incompatible methods Delete a Link Reopening a link after closing Create new project when existing project is open Saving a project Trying to create a project with an existing name Enter the info. Enter incorrect info. Running the Android application

Result
Opens correctly. Choose the project you want and it opens in the screen. Component box is added to the UML display. Line is drawn between the two components. The method link table appears. Error message appears. A line is drawn between the methods. Error message appears. Line disappears. It remembers the method links and shows the lines still there. Warns the user if they want to save it, then new project opens. Saves an instance of all the classes. Warns the user they cannot use that name. Creates an Android application Warns the user of their errors Runs in the android emulator.

Table 6.5: Showing results from my tests Proof of the results in Table 6.5 is shown in appendix 1: Thorough testing proof, with the use of print screens.

6.4 Important & Interesting Results


After completing the evaluations I quickly realised that my interpretation of what is user friendly is not always what other users define to be user friendly. The main issue that kept cropping up was the lack of error messages, which I didnt notice myself as I knew how the program worked inside out so the lack of error messages did not bother me. Another interesting result was that all the evaluators tried and thought it would be best to click the line instead of holding ctrl and clicking the two components. After thinking hard about this I decided not to change this mainly as clicking both components allows the user to choose which side they want each component on the method window and also if there are many links it might be difficult to click the correct line.

47

6.5 Summary
Overall the testing went really well, I was able to implement almost all the changes suggested that I agreed with, obviously some changes I did not agree with and when suggesting my reasons why to the evaluators they came around to my way of thinking and agreed to leave it the way it originally was. I believe that my system is much more user friendly now I have completed testing and was able to eradicate some errors that where found and dealing with user errors is now much better.

48

7. Conclusion
7.1 Review of Aims
7.1.1 Easy to Use Application Builder I have achieved this aim so the user does as little as possible to wire components into an application. This is done by simply clicking the two boxes representing the components to be linked. To make the selection of components simple and to minimise confusion, I have split the components into different categories. Furthermore, I have included a description box that is automatically populated when the user selects a method. This allows the user to review the input parameters and return type before selecting the links. Lastly, after one of my evaluators accidentally clicked the wrong method to link components, I realised that it would be a good idea to add a function that let the user delete any links they created. [8] 7.1.2 Allows the user to Create Android Applications I was able to get this working the best I could. I wanted to make it so the application would automatically be added to the Eclipse workspace but after plenty of research I finally discovered the metadata for the eclipse workspace was stored in a binary file that I was unable to edit. I believe I was able to ease this problem by putting a link to Eclipse in the system so it only took a few clicks to import the Application. 7.1.3 Allow Applications to be Created with Components I was able to achieve this by linking components together with their public methods. I slightly altered this from the design specification where I said it would have receiver and provider outputs from the component box. I changed it to have a single line representing many links that could be expanded into a separate window containing all the method links, I believed this was better as if two components have many links between them it got a bit messy and hard to understand. And because my main aim was to create an easy to use application builder, I thought this also assisted to make it easier to use. 7.1.4 Easing Problems Creating Android Application This was achieved because now anyone is able to create an Android application with limited knowledge, obviously a good knowledge of the Android operating system helps. But with the use of reusable components you dont need to write the actual code you just link the methods so a good knowledge of java is enough to create your first simple Android application. 7.1.5 Turning Applications into Reusable Components Unfortunately I was unable to complete this aim to the full extent as I believe it wasnt the most important feature, and that it was more important to get the rest fully functioning with some good components to test it with. Therefore this would be a good task to complete in the future. 49

Although I did think it was kind of a redundant idea when I introduced the save and reload function to the instances of unfinished projects, here a user could create the application but instead of finalising it into an Android application they could simply save it as a unfinished project and load it up at a later date to use as a component. Furthermore I gave the user the ability to manually add their own components to the component folders.

7.2 Done Anything Differently


There are three main things that I would do differently if I was to undertake this project again, these are: Spend less time on implementation and more time on the report as I spent five extra weeks implementing than planned. Got my first evaluator to complete the test earlier to allow more time for changes again this is because I spent so much time on my implementation. Instead of storing the component data in files on the local computer I could have saved them on a database on a server so components could be added and saved in a location accessible to all. Although I believe it was more important to get the functionality working fully. This would be a good add on if I was to complete any future work.

7.3 Future Work


Now that I have come to the end of my project there were still a few features that I would have liked to implement. Although these were not a necessity therefore I decided to prioritise and get other aspects done to a higher quality. Although if I was to come back to the project and expand on it I would firstly add a database to a server to store the components, this way its easier for updates to be made to components and any components made by other programmers can be shared much quicker. Although the downside of this is I would require a server to run the database on, which is again one of the reasons I opted out of it in this system. Another aspect I would have liked to add to my system was creating reusable components out of the applications created by users. But as I have previously stated a user can save their application as an unsaved project and when wanting to reuse it simply load it back up and add the extra components they require. Due to the amount of different operating systems there currently are it could be a good idea to port my system so its usable for the other operating systems, after doing a bit of research I discovered that many of the main smart phones and tablets all have flash players [9] therefore I could create a system that creates flash applications that run on a flash player on the selected phone meaning my product would be aimed at a wider scope of potential customers [7].

50

Finally, it would have been good to do a big survey to get the general consensus on what users feel the user interface is like to use, because in my opinion the GUI is the best it can be but everyones opinions vary and some users might find better ways of representing it.

7.4 Summary
Overall I varied from the initial specification only slightly, although I believe the changes where beneficial for the project. Firstly I changed how I represented a component, aiming for a simple box with one line representing receiver and provider interfaces. Instead of lines for both, this was to keep the UML diagram tidier and less cluttered. I also mentioned that I didnt implement the feature to allow the user to turn their applications into reusable components, which I really saw as a bonus feature, although with the ability to save instances of projects the user could save the instance of the project and load it up at any time to add more components to it. Therefore I completed all I aimed to do at a very high standard, instead of getting other features added and giving a lower overall standard of product. 7.4.1 What I learnt I have learnt a lot to give me the ability to create this product at a high standard which I believe will also help me in employment. Firstly I learnt how the Android works and how to create programs in the Android programming language. But the main thing I learnt about was how to create components for reuse and how to link them together. The final aspect I learnt was how valuable it is to get another persons perspective on a project, as working closely on a project can make you unaware of underlying problems, which others encountered when testing. 7.4.2 Overview Overall, I believe my project was a success even though I slightly varied from my specification I got all the main aims completed to a high standard. Plus I added a few more user friendly functions such as opening eclipse in the system, deleting links as from my own experience I know users make a lot of input errors, [8] making it so incompatible links cannot be made. Therefore my product has reached all the goals and is a very useful user friendly tool.

51

References
1. Gartner (2011). Android market share. Retrieved February 02, 2011, from http://www.gartner.com/it/page.jsp?id=1434613 2. Mobiforms (2011). Mobile Application Development Tools. Retrieved March 03, 2011, from www.mobiforms.com 3. Jaejoon Lee (2011). Software Reusability: Concepts and Practices via a lecture. Lancaster University, Lancaster, UK, February 2011 4. George T. Heineman & William T. Councill (2001). Component-Based Software Engineering 5. Android (2011). Android SDK. Retrieved March 03, 2011, from http://developer.android.com/sdk/index.html 6. Android (2011). What is android? Retrieved March 03, 2011, from http://developer.android.com/guide/basics/what-is-android.html 7. Dr Will Simm (2011). CSC242 iOS Android via a lecture. Lancaster University, Lancaster, UK, February 2011 8. Reliability (2011). The cost and truths of human error. Retrieved March 11, 2011, from http://www.reliability.com/healthcare/articleshcp/jan_08_Cost%20and%20Truths%20of %20Human%20Error.pdf 9. Cnet uk (2011). Which phones and tablets can play Flash? Retrieved March 17, 2011, from http://crave.cnet.co.uk/mobiles/which-phones-and-tablets-can-play-flash-heres-ourcomplete-guide-50003161/ 10. Avik Chaudhuri (2010). Language-Based Security on Android. University of Maryland. 11. Ian Sommerville (2004). Software Engineering, 7th edition 12. Felix Bachmann et al. (2000). Volume II: Technical Concepts of Component-Based Software Engineering, 2nd Edition 13. Wikipedia (2011) Component-based software engineering. Retrieved March 17, 2011, from http://en.wikipedia.org/wiki/Component-based_software_engineering 14. Ludger Martin (2011). Visual Development Environment Based on Component Technique. Darmstadt University of Technology 15. Hamish Cunningham et al. (2011). GATE: an Architecture for Development of Robust HLT Applications. University of Sheffield 16. Google (2011). About Android. Retrieved March 18, 2011, from http://www.google.com/mobile/android/ 17. Oracle (2011). Java API. Retrieved March 18, 2011, from http://download.oracle.com/javase/6/docs/api/overview-summary.html 18. Bized (2011). Changes in the Workplace. Retrieved March 21, 2011, from http://www.bized.co.uk/current/mind/2005_6/241005.htm 19. Wikipedia (2011). Interface Builder. Retrieved March 21, 2011, from http://en.wikipedia.org/wiki/Interface_Builder 20. Webopedia (2011). Black box testing. Retrieved March 22, 2011, from http://www.webopedia.com/TERM/B/Black_Box_Testing.html 21. Webopedia (2011). White box testing. Retrieved March 22, 2011, from http://www.webopedia.com/TERM/W/White_Box_Testing.html

52

Appendix
Appendix 1: Thorough Testing Proof

Figure 9.1: Test 1 program opening

Figure 9.2: Test 2 opening project

Figure 9.3: Test 2 choosing project to open

53

Figure 9.4: Test 2 showing the project open

Figure 9.5: Test 3 adding a component to the UML diagram

54

Figure 9.6: Test 4 linking two components

Figure 9.7: Test 5 opening method panel for two components

55

Figure 9.8: Test 6 trying to open two unlinked panels, nothing happens.

Figure 9.9: Test 7 viewing description with right click

Figure 9.10: Test 7 left click both components to draw link

Figure 9.11: Test 9 deleting a link, shows a link

Figure 9.12: Test 9 link clicked and it is deleted

56

Figure 9.13: Test 10 shows a method panel that has been closed and reopened, showing the link is still there

Figure 9.14: Test 11opening a new project

Figure 9.15: Test 11 asks the user is they want to save their current project

57

Figure 9.16: Test 11 choose their project name

Figure 9.17: Test 11 opens a new project

Figure 9.18: Test 12 saving a project

Figure 9.19: Test 12 choosing a name 58

Figure 9.20: Test 13 when using a taken name a warning message appears

Figure 9.21: Test 14 saving android project window 15.

Figure 9.22: Test 15 Filename taken! appears when using a taken filename

59

Figure 9.23: Test 16 running the project in the emulator

60

Appendix 2: Evaluation Form 1


1. Evaluator: ID (Name): Matthew Darnell Background/Experience: First Year computer science student at York University (has a good knowledge of java but little to no knowledge of the Android operating system) 2. Product description The product is a rapid application builder for the Android device allowing the user to simply create applications. This is done by linking two or more components via their methods. I put forward the following test cases to Matthew and he was able to give me back the result and positive or negative feedback: Aspect being evaluated
Opening the rapid application builder Creating a new project

Result (i.e. Inadequate, Satisfactory, Good, Very Good)


Good Very Good

Feedback/suggestion
Interface opened and is aesthetically pleasing. When opening the application a new project is opened. I think that this is convenient and allows time to be saved. Project could not be saved so this feature does not work. Adding a component is represented well by adding a box to the main display. Choosing what component to add is made easy as they are clearly labelled. Although, when working with more than one component if one has not been moved from its original place then a new component added will lie on top of the previous component. To link components I simply clicked on a component and subsequently clicked the desired component and a line is drawn between them on the display. I tried linking two components that are supposedly incompatible, however a link was drawn linking the two implying that they have been linked. Selecting a link works fine, however on my first attempt I tried clicking the line as this seemed like the most logical method for selection. I tried and nothing was selected as expected. As previously stated if clicking the line was how to select then it would not be possible to try a select a

Opening an existing project Adding a component

Inadequate Good

Linking two compatible components Trying to link two incompatible components Selecting a link between two components Trying to open the methods window for two unlinked components

Very Good

Inadequate

Good

Good

61

Linking two methods

Good

link that does not exist. Clicked a method to get a description then double clicked to select and then choose the second method to be linked with. I believe this is not the best technique for linking methods, I would prefer dragging one method towards another. Tried linking a method that should have taken a string as a parameter with a method that returned an integer. As these are incompatible types no line was drawn as expected, although I would have expected an error message as I tried linking again unaware it had failed. I just clicked the line between the two methods and it disappeared. To move components I simply clicked and dragged them to the position I wanted. This was as I expected although the mouse jumps to the top left of the selected component which can be irritating. Checked the folders containing the classes and noted that they corresponded with the tabs. The layout is logical and looks good as part of the interface. When opening a new project my previous project is closed. This could be an issue if I had unsaved work, therefore I feel that a message should appear warning me and giving me the option to save my work. After choosing to create the application I am prompted with a small screen where I enter details about my project. This is good as I can give the project a meaningful name so I will not lose the file. Saves the new project over the existing project that has the same name. Moreover I felt that I should have been warned about overwriting a file that could have been important. Entered the info works as expected, although after naming the file I would have liked to see the name in the window header of the system. I tried saving the file name as an empty string and the system would not let me save the file. Once more I believe that implemented error messages in

Linking two incompatible methods

Good

Delete a Link Moving components

Good Good

Clicking on different tabs on the component list

Very Good

Create new project

Satisfactory

Saving a project

Very Good

Trying to create a project with an existing name

Inadequate

Enter the info.

Good

Enter incorrect info.

Good

62

Running the Android application

Good

User guide

Good

instances such as this would make the system much more user friendly. I was able to create my first android application. I found that the transfer of the application from the system to eclipse was tedious and would have preferred the application to be added to the workspace automatically. After following through the example in the user guide I was able to create my first Android application.

Table 6.1: Results from Matthews tests 3. Evaluators summary I attempted to use the system before looking at the user manual and encountered several problems, however after reading the manual I was able to operate the system and eventually create and run an application for an android. Throughout the system I felt that extra comments such as error messages were required, as I mentioned in some of the tests. The interface itself is very easy on the eye and is easy to follow despite the lack of comments. I liked the visual representation of the classes as it hid the complexities of the code well and can make complicated problems seem simpler. Overall, I was very impressed that on one of my first tries I managed to successfully run an application on the android. It was a simple login page followed by an accepting page if the entered information was correct, although this application is very simple it highlights that the system is well structured and easy to follow since I was able to create an application with minimal knowledge of androids functionality.

63

Appendix 3: Evaluation Form 2


1. Evaluator: ID (Name): William Harding Background/Experience: Third year computer science student at Lancaster university, with a good knowledge of java. 2. Product description The product is a rapid application builder for the Android device allowing the user to simply create applications. This is done by linking two or more components via their methods. I put forward the following test cases to William and he was able to give me back the result and positive or negative feedback: Aspect being evaluated
Opening the rapid application builder Creating a new project Opening an existing project Adding a component Linking two compatible components Trying to link two incompatible components Selecting a link between two components Trying to open the methods window for two unlinked components Linking two methods Linking two incompatible methods Moving components Clicking on different tabs on the component list Create new project Saving a project Trying to create a project with an existing name Enter the info. Enter incorrect info. Running the Android application User guide Delete a method link

Result (i.e. Inadequate, Satisfactory, Good, Very Good)


Good Very good Good Very good Very good N/A Satisfactory Very good Very good Good Very good Very good Very good Very good Very good Very good Very good Good Very good Very good

Feedback/suggestion
Quick to open Done when application is opened Easy to find previous projects for opening Easy to do Click on both components to link

Tried clicking line but must press ctrl then click both components Does nothing Just left click to link or right click to bring up method text / description Does not allow linking Click and drag Changes quickly Easy to create new Brings up menu when create new Says file name is taken Easy to do Says file name taken Ran reasonably quick on emulator Simple to follow and clear with pictures Just click on the link

Table 6.2: Results from Williams tests 64

Appendix 4: Evaluation Form 3


1. Evaluator: ID (Name): David J. Darnell Background/Experience: IT Engineer also has programmed in Unix (C) before. 2. Product description The product is a rapid application builder for the Android device allowing the user to simply create applications. This is done by linking two or more components via their methods. I put forward the following test cases to David and he was able to give me back the result and positive or negative feedback: Aspect being evaluated
Opening the rapid application builder Creating a new project Opening an existing project Adding a component Linking two compatible components Trying to link two incompatible components Selecting a link between two components Trying to open the methods window for two unlinked components Linking two methods

Result (i.e. Inadequate, Satisfactory, Good, Very Good)


Very Good Very Good Good

Feedback/suggestion
Opens very quickly and starts with a blank canvas. Automatically opens a new project. Would be better if the file menu was more set out like most windows compliant programs eg. New, Open, Save etc. Easy to add components Easy to link components but would have liked to have an unlink command. Might have been better selecting the link line rather than the component boxes. Perhaps an error message needs to be displayed when you try to open the method window for two unlinked components. When selecting the methods it would help if the method box changed colour. Needs to tell the user that the methods are incompatible. Easy to use Tab changes colour to show which component category you are in.

Very Good Very Good N/A Good Good

Good

Linking two incompatible methods Moving components Clicking on different tabs on the component list Create new project Saving a project Trying to create a project with an existing name

Good Very Good Very Good Very Good Very Good Very Good

Shows file name is already used

65

Enter the info. Enter incorrect info. Running the Android application User guide Delete a method link

Very Good Good Very Good Very Good Very Good

Easy to use Needs more error reporting to the user. Works well Easy to follow Simple to complete

Table 6.3: Results from Davids tests

66

Appendix 5: Evaluation Form 4


1. Evaluator: ID (Name): Adam Nierzad Background/Experience: Third year computer science student at Lancaster university, with a good knowledge of java. 2. Product description The product is a rapid application builder for the Android device allowing the user to simply create applications. This is done by linking two or more components via their methods. I put forward the following test cases to Adam and he was able to give me back the result and positive or negative feedback: Aspect being evaluated
Opening the rapid application builder Creating a new project Opening an existing project Adding a component Linking two compatible components Trying to link two incompatible components Selecting a link between two components Trying to open the methods window for two unlinked components Linking two methods Linking two incompatible methods Moving components Clicking on different tabs on the component list Create new project Saving a project Trying to create a project with an existing name Enter the info. Enter incorrect info. Running the Android application User guide

Result (i.e. Inadequate, Satisfactory, Good, Very Good)


Very Good Good Very good Very good Very good N/A Very good Very good Very good Good -

Feedback/suggestion

Opens in a new project ready to use Liked the list showing the saved projects Easy to use Liked the error message Liked how it appears within a new window. Again I like the use of error messages, could be a bit more in depth though e.g. this method takes a String, you tried to put in an int. Liked how it asks me if I want to save the existing project Straightforward to use menu After following the step by step guide I

Very good Very good Very good Very good Very good Very good Good Very good Very good

67

Delete a method link

Good

was able to work through the program with simplicity Maybe display a warning if accidently pressed?

Table 6.2: Results from Adams tests

68

Appendix 6: User Manual

69

Appendix 7: Proposal

Abstract
In this report I will present a proposal for my project, the project I have decided to do is a rapid application builder for an android mobile phone. So the main two areas of my project will be the component-based software engineering and the android operating system. I believe this is an important area as it means creating applications for the android will be a lot quicker for programmers and also generic components can be shared between programmers. Therefore my project will involve two phases, creating the components for reuse and then a way of integrating the components together. Finally the results that I expect from my project are a component-based UML diagram that includes all the different types of components. Also it will have the ability for other programmers to add their own components for reuse.

1. Introduction
In this project I will be focusing on creating a rapid application builder for an android mobile phone. This means with the use of reusable components programmers will be able to create applications with greater ease and much quicker than before. This will be achieved by using component-based software engineering (CBSE), which emerged in the late 1990s as a method of system development with the use of reusing software components. The reasoning behind using CBSE is because object-oriented development does not support reuse as effectively, due to the fact you have to have a detailed knowledge of the source code (pg 453). Therefore CBSE would be a better choice as the customers of the project will not know the code. The main part of the project will be to use CBSE for reuse (creating the components that will then be used by other programmers). The customer will then use CBSE with reuse (creating a system that uses components that where created in my project). This will then finally allow the programmers to add their own components to the system, allowing other programmers to integrate them into their own projects. A user friendly UML component diagram will be created, split into sections e.g. validation. So that programmers are easily able to chose the sections they are interested in. Each component will be displayed in boxes with arrows going in and out. The arrows out will represent what the component provides to other components, and the arrows in will represent what the component requires to function fully. Finally the operating system that I will be developing the reusable components for is the android operating system. This is a relatively new operating system for mobile devices that has been developed by Android Inc. which is now owned by Google. (www.wikipedia.com). Android uses Google developed java libraries, for its
70

applications. The applications will then either be tested on an Android emulator, or an Android mobile phone to check that applications can be created using the reusable components. This report consists of a background of the subject in hand, this will include an outline of CBSE and how I will be using it, and also some research into what other similar systems there are out there. This will be followed by my proposed project this will give a detailed overview of the aims and objectives of the project. Furthermore methodology I will be undertaking. The programme of work will show how I plan to do the work required this will be displayed with the use of a Gantt chart. The report will then be concluded with the resources that will be required to achieve the aims of the projects.

2. Background
Being able to produce any kind of product quickly has always been a key issue in programming, if it is just a small piece of code that programmers will have to program over and over again. Or a large piece of code that consists of sections that other programmers will have implemented before. This could easily be managed with the use of components, so that programmers will be able to produce the product much quicker and effectively. I believe that this has a much greater effect on mobile phone applications, because there are a lot of aspects that will be used a lot of times, for example a login screen and validation. With the use of components the implementation time of this would be reduced substantially. And with the lack of rapid application builders for the android phone out there at the moment, it is a key area that needs a solution. 2.1 Existing technologies After researching the subject on the internet I came across only one current rapid application development tool for the Android, the company that has designed this is www.mobiforms.com although this product costs 99, and is used purely to create business applications, such as Market research and Stock control. Whereas the product I will be creating is going to have a much wider scope of generic components. Also my product will further their ideas by allowing the developers to add their own reusable components to the system once they have finished with them. Other than this I was unable to find any rivalling software, meaning that the only other current alternative is for developers to write the code from scratch, taking them much longer than if they used a rapid application builder. Although the Google API is rather helpful, the programmers still have to write the code, whereas with reusable components they can just reuse the components that do what they want. Although on the other hand, programmers are currently able to use other programmers code, yet this would not be simple as they would need to understand what the code does.
71

Also because it will be object-oriented single classes are usually too complicated and specific for certain programs. (pg 453). Therefore I believe that this software is well needed.

3. Proposed project
3.1 Aims and Objectives The main goal of my project is to create an easy to use UML component diagram that allows the user to couple reusable components together. The components that will be used will be components for the applications that are to run on the Android operating system. 3.1.1 Components The components that will be used in the project will be small parts of code that make up an Android application. These components will be generic so they can be used for several purposes, thus making them more reusable. 3.1.2 CBSE for reuse This means that the components that are developed and part of the system are for other developers to reuse. They will then develop a program using CBSE with reuse. As the diagram below shows:

CBSE for reuse

CBSE with reuse

Component Acquisition

Component certification

Component management

Component repository

(Kotonya, 2003)

72

As you can see in the diagram, it shows main implementer of the components (me), creating the components that are going to be reused. There are then three main processes for CBSE. These are component acquisition, component management and component certification. For my project I am not concerned with component certification so this does not matter. Component acquisition is how the developer will obtain the reusable components. It will gather the reusable components from the component management which is where the components are made available for reuse (pg 461). So this is my main part of the project, being able to create components that then can be coupled with other components to rapidly create an Android application. To further build on this idea, the users will be able to add their components to the system once they have created them. 3.1.3 User interface The user interface will be an important feature of the project as it needs to be easy to use yet able to cope with the complex requests from users. Therefore it shall be split in to separate interfaces for each area e.g. validation or resource management, thus making it easier for users to select the area their interested in. They will then be able to switch through the different areas with the use of tabs. The main UML diagram will be displayed in the middle of the screen, which will show the components as boxes with the name of the component displayed on it. They will then have arrows coming into the box (requires interface) and arrows going out (provides interface). These arrows will be represented as below:
Requires interface Validation Provides interface

When a provides arrow is dragged from one component to another a pop up box will display the methods that are able to link the two components and the parameters that they take.

73

Below is a quick diagram of what will be provided in the user interface:


List of different components UML component diagram

Tabs to select relevant area

3.1.4 Testing As with any kind of program that is produced, I will need to undertake extensive testing, to make sure that it means requirements, make sure it is reliable and there are no bugs in the code. Examples of the tests that could be completed would be trying to couple components together that have no link (the end result should be that they dont couple), and making sure that components do couple together that have a link. The user interface will need testing to make sure there are no errors stopping the usability of the system. 3.2 Methodology Due to the nature of the project the best software engineering approach would obviously be component-based software engineering, as the whole of my project revolves around reusable components. To test the project I am going to create test cases that I will test myself, once I have completed all the test cases and am happy with the quality of the product. The product will then be released to groups of testers. This will be done using two methods: Questionnaires multiple choice questionnaires (easier to get a more specific answer) will be sent out to a large group of potential customers, will include questions asking what they believe the user interface should contain and other user friendly questions.
74

Prototype Then a smaller group of people (5 people), will be given a prototype of the product to work though to try to discover errors or any recommendations on what could potentially need changing. Once listening to these recommendations, the product will then be changed as necessary. Finally the product will be released.

4. Programme of work
The project will be starting over the summer holidays up until the end of the lent term, this gives me 20 weeks of term time, and then time over the holidays. Listed below are the milestones that I am aiming to complete, these are then added to a Gantt chart to show how many weeks I am planning on each task taking me. 1. Practice building Android applications At the moment I have never build an Android application so I feel that over the summer holiday I need to get an extensive knowledge of the Android programming language. 2. Practise using Eclipse and Android emulator After writing the Android applications, I will need to know how to run the applications using the emulator. 3. Research CBSE Again I do not have a vast knowledge on component-based systems, so before I start any proper work I need to learn more. 4. Design the solution Create a detailed design for the product, this will include the architecture, class diagrams, user interface and acceptance tests. 5. Implement the solution The next step is to implement the solution from the design, this will be done in java. 6. Test the initial solution Testing will be carried out on the first solution this will be to remove any bugs / errors. 7. Detailed testing This testing will be completed after the prototype has been given to the customers, making sure there are definitely no errors. 8. Finish the solution The solution will be finished, fully documented and ready to be released to the customers. 9. Finish the report The Gantt chart on the next page shows how these milestones follow on from each other. I decided that most of the Christmas holidays will be left free, this then gives me time to catch up on any overdue work on the project I havent been able to complete on time.

75

5. Resources required
Eclipse IDE Used to write the Android applications in and to write my rapid application builder Google SDK Used to develop Android applications Android emulator / Android mobile device Used to run / test the Android applications created using the rapid application builder. Java The Android application and rapid application builder will be written in the java programming language. Suitable PC To run the rapid application builder.

6. References Wikipedia o www.wikipedia.org o http://en.wikipedia.org/wiki/Android_(operating_system) Mobiforms o www.mobiforms.com

76

Das könnte Ihnen auch gefallen