Wednesday, 16 January 2013

Software as a Service

Here we discuss the main ideas of  Software Engineering for Software as a Service(SaaS) course by edX. This course teaches the fundamentals for engineering long-lasting software using Agile techniques and Ruby on Rails.

The introduction of the
edX - gives a comparison of software and hardware based on their nature.
Hardware designs are finished before manufactured and shipped to the respective vendors. If there is a bug in the hardware the only solution is to change the whole Hardware. Also the quality of the hardware diminishes with time and the cost of upgrade seems to be infinitely. Hardware prototypes aim at verification -ensuring that hardware meets the specifications.
On contrary, Software evolves over time and if there is a bug in a software only a software update is required to eradicate the bug. And cost of upgrade seems to be nearly zero. Software prototypes aims with validation, since unlike hardware; customers can demand and receive changes to software.

There are two kinds of softwares: Legacy S/W and Beautiful S/W.
 
Legacy s/w are those which satisfies users needs but difficult to evolve due to design inelegance or antiquated technology.Currently, 60% of s/w maintenance cost is used for adding new functionality to the legacy s/w and only 17% for bug fixing.
 
Beautiful s/w meets customer needs and are easy to evolve.
Yet, there is a third kind of software known as Unexpectedly short-lived code that doesn't meet customers’ requirements.

There are different approaches for s/w development.
First one is Waterfall model. The levels in waterfall model are:
  1. Requirement specification
  2. Design
  3. Construction(implementation or coding)
  4. Integration
  5. Testing and debugging
  6. Installation
  7. Maintenance
The main drawback of this model is that, when the customer is unclear or less specific about the requirements, the developed model mail fail to meet the goals.
The second one is Spiral model. In this model, a prototype is built in every phase discussed above and then developed in each phase.
  1. Determine the objectives, alternatives, and constraints on the new iteration.
  2. Evaluate alternatives and identify and resolve risk issues.
  3. Develop and verify the product for this iteration.
  4. Plan the next iteration.
This also helps in back tracking, reversing or revising the process.



The third is Agile model. The key features of this model are:
  • Embraces change as a fact of life: continuous improvement vs. phases.
  • Developers continuously refine working but incomplete prototype until customers happy, with customer feedback on each iteration (every ~2 weeks).
  • Agile emphasizes Test-Driven Development (TDD) to reduce mistakes, written down User Stories to validate customer requirements, Velocity to measure progress.

Testing and Formal methods

Testing cannot be exhausting. Testing has many levels:
  • The base thing is called unit testing. That's testing to see if a single method does what's expected.
  • The next level is module or functional testing to test across individual units, like with across classes versus within a class.
  • Integration testing is to try and see if a bunch of modules communicate correctly. It's a more narrow interface., and each time when we add one of these things, we're assuming the one below does that work.
  • Finally, at the top is system or acceptance testing, tests weather the whole program meet what the customer wants it to do.
Types of Testing:
  1. Coverage testing specifies the percentage of code paths that have been tested.
  2. Regression testing is used to automatically rerun old tests to ensure that the current version still works at least as well as it used to.
  3. Continuous integration testing, which means the entire program is tested every time new code is checked in, versus later phases.

Formal methods starts with formal specification and prove program behavior follows software specification. These are mathematical proofs, either done by a person or done by a computer using either automatic theorem proving or model checking.
Testing and formal methods reduce the risks of errors in designs.
Both hardware and software engineers developed four fundamental mechanisms to improve their productivity:
  • Clarity via conciseness
  • Synthesis
  • Reuse
  • Automation and Tools

Software as a Service (SaaS)

Software as a Service (SaaS) delivers software and data as a service over the Internet, usually via a thin program such as a browser that runs on local client devices instead of binary code that must be installed and runs wholly on that device. Eg: searching, social networking, and videos.

      The reasons for SaaS

  • Users don’t have to worry about hardware compatibility issues and version of the operating system.
  • No worries about losing data at remote site.
  • SaaS is appropriate for the group of users to interact with the same data.
  • When data is large or updated frequently, it is simpler to centralize data.
  • Only a single copy of the server software runs in hardware, which avoids the compatibility hassles for developers.




Service oriented Architecture(SOA)

SaaS is a special case of a software architecture where all components are designed to be services. SOA actually means that components of an application act as interoperable services, and can be used independently and recombined in other applications.The contrasting implementation is considered a 'software silo', which rarely has APIs to internal components.
SaaS has 3 demands on infrastructure,

  • Communication- Allow customers to interact with the services.
  • Scalability- Fluctuations in demand during new services to add users rapidly.
  • Dependability- Service and communication available at any time.
The critical distinction of SOA is that no service can name or access another service’s data; it can only make requests for data through an external API.
Collections of commodity small-scale computers connected by commodity Ethernet switches- clusters, offeres scalable and much cheaper serving.The public cloud services or utility computing offers computing, storage, and communication at pennies per hour.




Cloud Computing
Cloud Computing provides the scalable and dependable hardware computation and storage for SaaS. Cloud computing consists of clusters of commodity servers that are connected by local area network switches, with a software layer providing sufficient redundancy to make this cost-effective hardware dependable.


Tuesday, 8 January 2013

PAINT

paint


Google App Engine


Google App Engine lets you run web applications on Google's infrastructure. App engine does not need any servers to be maintained, we just need to upload the application in the framework.
App engine supports programmes written in languages such as java, python ,go etc.

Main features of app engine are:
  • Dynamic web serving, with full support for common web technologies
  • Persistent storage with queries, sorting and transactions
  • Automatic scaling and load balancing
  • APIs for authenticating users and sending email using Google Accounts
  • A fully featured local development environment that simulates Google App Engine on your computer
  • Task queues for performing work outside of the scope of a web request
  • Scheduled tasks for triggering events at specified times and regular interval

App engine in python environment

It is very simple to set up an app engine application written in python. The first step here is to download the python software development kit (SDK) which  includes a web server application that simulates the App Engine environment. You could download the python SDK here
To set up a web application using google app engine, the below given steps are followed:
  1. Sign into the Google App Engine and create an application. A unique application id is selected for each application.
  2. Create a folder named after the application id in your home directory.
  3. Add file named app.yaml containing the following code.
application: app_id
version: 1
api_version: 1
runtime: python
handlers:

- url: /.*
  script: main.py 
here app_id represents the application id selected.

     4.  Create a file named main.py containing the following code

import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp import Request
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

class main1(webapp.RequestHandler):
 def get(self):
           self.response.out.write(template.render("exampleprogram.html",{})) 
  
def main():
    app = webapp.WSGIApplication([
        (r'.*',main1)], debug=True)
    wsgiref.handlers.CGIHandler().run(app)

if __name__ == "__main__":
    main()where exampleprogramm.html represents the application program.
Testing and uploading the application
As the first step,to enable the web server, the following command is used.
google_appengine/dev_appserver.py "path"
The path set will be the path to application id directory.

To verify the output of the application, paste the below given url in your browser.

http://localhost:8080/
Once the desired output is produced, you can upload the application to google app engine using the following command.

appcfg.py update "path"
Here also, the path given will be the path to application id directory.
That finishes the work and the application will be available in the address http://your_app_id.appspot.com.