Trending

23
Aug

Python SQLAlchemy

Python SQLAlchemy and Object-Relational Mapping

Whenever it comes to programming a web service, you will require a solid database backend. In the past, programmers used to write raw SQL statements, pass them to the database engine and parse the returned results as a normal array of records. Nowadays, programmers can write Object-Relational Mapping (ORM) programs to remove the necessity of writing tedious and error-prone raw SQL statements.

 

WHAT IS ORM?

Most programming language platforms are object oriented. ORM is a programming technique for converting data between incompatible type systems in object-oriented programming languages. Data in RDBMS (Relational Database Management System) servers on the other hand is stored as tables. Object relation mapping is a technique of mapping object parameters to the underlying RDBMS table structure. An ORM API provides methods to perform create, read, update, delete (CRUD) operations without having to write raw SQL statements. So basically, an ORM takes care of these issues while you can focus on programming the logics of the system.

 

Installation:

In order to run the python script with SQLAlchemy codes in it, you need to install flask-sqlalchemy extension first for that run the command :

 

Let’s Get To Know SQLAlchemy

 

For using functions from SQLAlchemy in your program, you need to import it first using the statement :

Now you can create your Flask application and make surem you set the URI for the database which is to be used in your program.

Now, you need to create an object of SQLAlchemy class with the application object provided as parameter. The object provides helper functions for ORM operations and also provides a Model class using which user-defined models for database is declared. In the following code snippet a persons model is created:

To create or use the database that we specified in the URI run the create_all() method.

To add an object data to the database we can use the following code:

For deleting just replace the add function with delete function and if you need to retrieve the records of the table use:

You can also apply filters while retrieving records. For eg:

will return the set of table rows whose city attribute is equal to ‘Mumbai’.

 

SAMPLE PROGRAM

 

Now, let’s see an entire program based on what we’ve learned so far:

First let’s setup an html page to display our database contents.

 

We’ve set an HTML page with a heading SQLAlchemy Test and it has a table with two columns to display a persons name and phone number. Now we need to code a python script to do our job.

In the above python script, we create a model class for person which can hold values for a person’s name and phone number. We set the route of out app to the homepage of localhost. So after running the app, when you open the browser and visit your localhost homepage by typing 127.0.0.1:5000 in your browser’s address bar, you can see the html page we’ve setup. It will show all function finally returns the rendered template of show_all.html populated with the contents in the database.

Now, we can checkout how we add contents to the database. For that we need to create objects of our model class and provide values for its attributes i.e. name and phone of a person. Now we can add it to our database using SQLAlchemy_object.session.add(model object) function. After adding all the values make sure you commit the changes to the database in order to prevent data corruption. Now, we have our database ready with contents, we can display it on our html page using render template(‘html_file_name’, model = model.query.all()) function.

Save the python file and place the html file in a folder named templates.  If no such folder exists create one. Now you can run the python script and visit 127.0.0.1:5000 in your browser to see your app running.

 

Benefits of SQLAlchemy:

According to http://pajhome.org.uk/blog/10_reasons_to_love_sqlalchemy.html here are the top 10 reasons to love SQLAlchemy

  • Let’s you define the database schema in your code
  • Automatically synchronise the model and schema
  • Easy to read
  • Simple queries.
  • Seamless integration with web frameworks
  • Fast loading, Better performance
  • Transparent Polymorphism
  • Works with legacy frameworks
  • Easy to customise the library
  • Great Documentation

 

Challenges of SQLAlchemy.

  • The concept of unit of work is not very known among the developer community
  • A heavy-weight API

 

 

21
Aug

Python Scrapy Library

What is Scrapy??

 

Scrapy is an open source and collaborative framework for extracting the data you need from websites in a fast, simple, yet extensible way.

 

But what do you mean be scraping data?

 

Web scraping is a computer software technique of extracting information from websites. This technique mostly focuses on the transformation of unstructured data (HTML format) on the web into structured data (database or spreadsheet).

In python, web scraping can be done using scrapy.

 

Let’s get started.

Installation first.

You can easily install using pip. For other installation option, click here. Type the following to your command prompt.

Now, let’s get our hand on some coding.

Let’s start off by creating a scrapy project. Enter the directory of your choice and type in the following.

Something like this prints out for you.

You can start your first spider with:

This will create a directory tutorial with the following contents.

tutorial/

scrapy.cfg            # deploy configuration file

 

tutorial/             # project’s Python module, you’ll import your code from here

__init__.py

 

items.py          # project items definition file

 

pipelines.py      # project pipelines file

 

settings.py       # project settings file

 

spiders/          # a directory where you’ll later put your spiders

__init__.py

 

Now let’s create a spider, but what are spiders?

Spiders are classes that you define and that Scrapy uses to scrape information from a website (or a group of websites). They must have a  subclass scrapy. Spider and define the initial requests to make, optionally how to follow links in the pages, and how to parse the downloaded page content to extract data.

We will be using examples from the official doc.

So save the following code in a file named quotes_spider.py under the tutorial/spiders directory in your project:

As you can see, our Spider subclasses scrapy.Spider

Let’s see wha teach of the attributes and methods mean.

  • name: identifies the Spider. It must be unique within a project, that is, you can’t set the same name for different Spiders.
  • start_requests(): must return an iterable of Requests (you can return a list of requests or write a generator function) which the Spider will begin to crawl from. Subsequent requests will be generated successively from these initial requests.
  • parse(): a method that will be called to handle the response downloaded for each of the requests made. The response parameter is an instance of TextResponse that holds the page content and has further helpful methods to handle it.

The parse() method usually parses the response, extracting the scraped data as dicts and also finding new URLs to follow and creating new requests (Request) from them.

 

Now let’s run our spider.

Go to the top level directory and type in the following in your cmd.

This command runs the spider with name quotes that we’ve just added, that will send some requests for the quotes.toscrape.com domain. You will get an output similar to this:

… (omitted for brevity)

 

Source:https://doc.scrapy.org/en/latest/intro/tutorial.html

Note:

Two new files have been created in the directory you were at. quotes-1.html and quotes-2.html, with the content for the respective URLs, as our parse method instructs.

Beautiful! Isn’t it?

Benefits of Scrapy:

  • Scrapy is a full framework for web crawling which has the tools to manage every stage of a web crawl,
  • Comparing with Beautiful Soup, you need to provide a specific url, and Beautiful Soup will help you get the data from that page. You can give Scrapy a start url, and it will go on, crawling and extracting data, without having to explicitly give it every single URL.
  • It can crawl the contents of your webpage prior to extracting.”

 

Challenges of Scrapy:

  • To parse just a few webpages, Scrapy is an overkill. Beautiful soup is better.

 

To learn to play with scrapy, check out

https://doc.scrapy.org/en/latest/intro/tutorial.html

www.tutorialspoint.com/scrapy/

 

19
Aug

Python Requests Library

What is Requests?

Requests is an elegant and simple Apache2 licensed  HTTP library for Python. It is designed to be used by humans to interact with the language. This means you don’t have to manually add query strings to URLs, or form-encode your POST data.

Requests will allow you to send HTTP/1.1 requests using Python. With it, you can add content like headers, form data, multipart files, and parameters via simple Python libraries. It also allows you to access the response data of Python in the same way.

 

Installation:

 

Here, I am installing using pip. For more options, visit.

 

Let’s get started.

First lets import requests

Here, i am using a webpage within my server which open to a page like this.

 

Let’s create a Response Object r

Let’s check the current status of the site

 

Let’s get the content of the site

 

To know what encoding it uses,

Let’s change that to say,

 

You might want to do this in any situation where you can apply special logic to work out what the encoding of the content will be. For example, HTTP and XML have the ability to specify their encoding in their body. In situations like this, you should use r.content to find the encoding, and then set r.encoding. This will let you use r.text with the correct encoding.

Requests will also use custom encoding in the event. If you have created your own encoding and registered it with the codecs module, you can simply use the codec name as the value of r.encoding and Requests will handle the decoding for you.

 

There’s also a builtin JSON decoder, in case you’re dealing with JSON data:

 

With every request you send to a HTTP server, the server will send you some additional data. You can get extract data from an HTTP response using:

 

Benefits of Requests.

This is the list of features from the requests site:

  • International Domains and URLs
  • Keep-Alive & Connection Pooling
  • Sessions with Cookie Persistence
  • Browser-style SSL Verification
  • Basic/Digest Authentication
  • Elegant Key/Value Cookies
  • Automatic Decompression
  • Unicode Response Bodies
  • Multipart File Uploads
  • Connection Timeouts
  • .netrc support
  • List item
  • Python 2.6—3.4
  • Thread-safe.

An awesome lotta features!Right?

 

 

 

To know more,

http://docs.python-requests.org/en/master/

http://docs.python-requests.org/en/latest/api/

http://pypi.python.org/pypi/requests

http://docs.python-requests.org/en/latest/user/quickstart/

http://isbullsh.it/2012/06/Rest-api-in-python/#requests

http://docs.python-requests.org/en/master/user/quickstart/

 

15
Aug

Python Projects

Python is one of the most loved and powerful languages to code in. It’s an interpreted, object-oriented, high-level programming language with dynamic semantics. Python’s simple, easy to learn syntax makes it very easy to read and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse.

After you play around with python, you would of course want to do something serious, like maybe a python project. Here, we have complied a list of top 4 sites where you could go and download python projects for your different needs, maybe for practice, references or sometimes for your final year projects. Hope this helps!

 

Free Projectz

You can download python project concept, abstract and source code for free at Free Projectz. Some of the interesting projects there are Doctor Appointment SystemUser Management, Live Photo Gallery etc.

Kashipara

With 300000+ members and 1500+ projects, you will find a variety of Python projects you can download and work on from Kashipara. They have a really good collection for mini and major projects and even have the best projects ranked on the basis of hits per day and month. Few interesting projects are ATM Software – Python, Online Video Chat – Python,Restaurant Management System – PythonTODO List – PythonVirtual Memory Management System – PythonInsta Raider – Python etc

Free Projects Code

Free Projects Code has a lot of sample mini and major projects that you can download and study. Few of them are Download Search Engine Python Script, Download Virtual Memory Management System, Download Video Chat Application, Internet Usage Monitoring System For Linux SystemsATM Software Engineering Project, Web Based File Hosting and Syncing Service Project Report

1000 Projects

Below are some of the projects developed by 1000 Projects. Google Finance currency calculator API,using aprori on website to get relevant data, Game like tic tac toe ,Note/content sharing platform for college students, book information parsing tool developed for opencart, AI Crosswords, An algorithm for steganography of multiple heterogeneous files on a single video carrier etc. For downloads, visit the site.

Any projects or sites we missed? Let us know by commenting down below. We love hearing from you. Hope this list helped.

 Have fun with Python!

 

11
Aug

Apple HomePod

 

Apple joins in the race of voice enabled virtual assistant device with HomePod. It can respond to human commands and control smart home gadgets.  However , Apple insists that it is primarily a music device with superior audio powered by it’s long standing voice assistant Siri. According to Apple CEO Tim Cook “The thing that has arguably not gotten a great level of focus is music in the home. So we decided we would combine great sound and an intelligent speaker”.

  

Release and Availability

HomePod will be released in the US, UK and Australia in December 2017. Initially, it would only support English language voice commands.It will be available in other countries starting 2018.

 

Cost

It will cost US $349. That’s more than double the cost of Google and Amazon’s alternatives, typical apple style. However , many apple fans will still be loyal to it and would love to see what it brings to the table.  Apple says that when kept in center of room it plays sound in all directions and if kept in corner it will aim the output away from the wall. It can also act as stereo speaker by connecting to other sound devices. If the claims come out to be true , it might be worth the extra cash.

 

 Appearance

HomePod is a heavy-looking cylindrical gadget nearly 7 inch tall that comes with seven tweeter beam forming array, six microphones , a four-inch woofer for a more immersive experience. It has iPhone A8 chip that determine the size and layout of the room which will adapt sound quality to fit the room.

HomePod is designed for voice control with an array of six microphones, so users can interact with it from across the room, even while loud music is playing. You can tap the top of HomePod to play , pause or adjust volume. LED waveform on top indicate whether Siri is listening.

Since it’s yet unreleased, not much can be said about it’s qualitative aspects.

 

Security

Security is fundamental aspect of any data based technology, therefore, all data is stored locally on your device and is sent to servers via cryptic methods using anonymous Siri Id. So, there is nothing to fret about with HomePod around. Your identity and information is safe.

 

Personal assistance

It springs into life on hearing “Hey Siri”. It’s personal assistance roles include news briefings, language translation, weather, traffic info, set reminders, play podcasts among others. Simply speaking we can ask Siri , any question we generally need browsing or app launching for.

“Hey Siri , set an alarm for 7 am tomorrow”.

“Hey Siri , Did Delhi Daredevils win last night?”

 

Integrations

It will likely work with Apple’s established HomeKit partners:  Ecobee, Honeywell, Chamberlain, D-Link, Philips Hue, Lutron, iDevices and more. However ,the only music streaming service that is supported by Homepad is Apple Music. Users of other popular platforms like Spotify will be disappointed. But this is not new for apple users.

HomePod can also send text messages to others. Like it’s counterpart it offers many tools to help around house such as calendar synchronization, kitchen timers and alarms.

Comment and share this post if you like it and want us to add more posts like this.

9
Aug

Other Assistants by Amazon

 

Amazon added new products to the battle of smart speakers, namely, Amazon Echo Dot and Amazon Tap. Both differ slightly from their predecessor in traits however, core values remain the same.

Amazon Echo Dot

 

Echo Dot is the mini version of Amazon Echo and still provides all Alexa’s quirks.

However, it does compromises on the quality of speaker to cut down on cost. A smaller built-in speaker does let you talk to Alexa, but it’s not good enough for streaming music. Also, it needs to be plugged in to work.

You might have to connect your own Bluetooth speakers through Bluetooth or 3.5 mm stereo cable to play music from Amazon Music, Spotify, Pandora, iHeartRadio, and TuneIn.

The Dot comes at an affordable price of $49.

 

BUY NOW

Amazon Tap

The Amazon Tap is another Wi-fi enabled digital assistant which takes the Echo’s fundamentals and packs them into a portable Bluetooth speaker. It is 6.5 inches tall and 2.5 inches wide , lasts for about 9 hours once fully charged. Unlike it’s counterparts, the Tap isn’t always listening. Instead, you have to press a mic button to speak to Alexa, which is disheartening to most users, but this is required to preserve the battery life. However, a recent update does allow you to enable hands-free listening at the expense of battery life.

It comes at a price of $129.

 

 

BUY NOW

Comment and share this post if you like it and want us to add more posts like this.

 

 

 

8
Aug

Amazon Echo vs. Google Home vs. Apple HomePod

Amazon Echo vs. Google Home vs. Apple HomePod

 

Intelligent voice controlled devices are among the latest trends and deciding the one that suits you best is troublesome. Amazon echo and Google Home are major rivals in the battle with Apple HomePod being a new entrant. With so much information available on what each device can or cannot do, one is left overwhelmed.

Here is a comparison of these devices listing both similarities and dissimilarities and stating which stands out in certain areas and which needs work.

Price

Amazon echo is priced at $179.99. However, the lowest amount that can get you Alexa, Echo dot, is mere $50, courtesy Amazon which always has been aggressive in pricing. Apple’s HomePod, like most Apple products, comes at a premium price of $349. An affordable alternative is Google Home at $129.

Design

HomePod is stout , cylindrical with glowing area on top similar to the siri logo indicating when siri is listening.     

 

   

 

Home has pretty plum like design,comes in various colors and finishes with upper section displaying google logo whereas volume and play/pause controls and speakers in the lower section.

        

 

Echo is longer cylinder with lower section as speakers. The top rim glows blue indicating ‘listening’ and two action buttons are also on top.

 

 

Music playlists

Music playback in HomePod limited to Apple Music only. On other hand, Home offers connection to Google Play Music, Spotify, Pandora, Deezer and more while Alexa can connect to Amazon Music, Spotify, Audible and Pandora. This shows limits of HomePod.

 

Specs

  • Echo and Home essentially are similar in intent. Both are mid range voice enabled virtual assistants.
  • Both have built-in mics to receive commands and respond intelligently via speakers. Also , they connect to other smart devices and operate them. However , as far as assistance is concerned Google is a leader in the area with it’s unmatched history with user and search data.

Contrary to these, Apple characterizes HomePod as a powerful wireless speaker that has Siri at it’s service, helping it carry out other smart operations and provide assistance.

  • The Echo has seven microphones waiting for trigger words while Home only has two mics with it and therefore, sometimes takes few seconds to awaken.
  • Home has only one 2in driver while Echo has two speakers; one woofer and one tweeter. The HomePod stands out with 4in upwards facing woofers. This will lead to an immersive sound experience with sound adapting to room space and layout.

The HomePod will definitely offer a better audio experience than Home or Echo.

 

Personal assistance

  • Both Echo and Home offer similar services but their performance on Ground zero is relative and dependent on many factors. 
  • Both can hear from a good 50 m distance without being confused with noise. However , Home’s voice recognition stands out. No much can be said about HomePod since it isn’t released yet.
  • According to a practical test conducted by Jay McGregor from Forbes , comparing Echo and Home, Home took home gold. You can read about it here.
  • Home is better with web results and Echo is better with shopping related queries.
  • Home is more conversational. It remembers context.

 

Smart Home

  • Google Home and Amazon Echo can easily work with iOS and Android devices. Application is needed to configure them and connect them to cloud.
  •  Amazon steps up in Smart Home department since Echo supports large number of smart devices in comparison to other two, nearly 11k in contrast to 200 for Home.
  • The Home handles August, Belkin Wemo, Frigidaire, Honeywell, Insignia, Lifx, Logitech Harmony, Next, Philips, Rachio, Samsung, TP-Link, and Wink, along with anything with a Chromecast attached to it.
  • The Echo supports all of those except Chromecast, but adds Blink, Carrier, DigitalStrom, Haiku, Leviton, Lowe’s Iris, Lutron, Netatmo, and many other kinds of devices.
  • Home enjoys an edge by supporting streaming services like HBO now.

 

The Echo remains a popular choice as of now with reasonable prices and  huge skill set. However, Home is fast catching up with better sound quality and assistance. HomePod is yet to be discovered but it is definitely promising.

Comment and share this post if you like it and want us to add more posts like this.

2
Aug

Setting Up Echo Dot

 

 

 

  1. Download the Alexa app from app store and sign in using your amazon account. 

You can also select a link below:

  1. Turn on Echo Dot.
  • Plug the included power adapter into Echo Dot and then into a power outlet.
  • The light ring on Echo Dot turns blue, and then orange.
  • When the light turns orange, Alexa greets you.

 

  1. Connect Echo Dot to a WiFi network.
  • In Alexa app, open the left navigation panel and then select Settings.
  • Select your device and then select Update WiFi. If you’re adding a new device to your account, select Set up a new device
  • On your Echo dot, press and hold the Action button. The light ring changes to orange, and your mobile device connects to your Echo dot. A list of available WiFi networks appear in the app.
  • Select your WiFi network and enter the network password (if required). If you don’t see your WiFi network, scroll down and select Add a Network (for hidden networks) or Rescan.
  • Select Connect. After your device connects to your WiFi network, a confirmation message appears in the app.

 

  1. Echo Dot is ready to use.
  • Your Echo device is ready for use.
  • To get started, say the wake word-”Alexa” which is default and then speak natural English commands to Alexa.
  • You can use the Alexa app to change the wake word at any time.
  • In the app, go to Settings, select  your Echo device, and then select Wake word.

 

If you are looking for video tutorial:

 

Comment and share this post if you like it and want us to add more posts like this.

1
Aug

Top Recommended PHP Books

 

PHP is the mostly commonly used language for Website and Web Application Development. It is a general purpose, server-side scripting language run a web server that’s designed to make dynamic pages and applications. PHP as a web development option is secure, fast and a reliable that offers lots more advantages to make it accessible to a lot of people. 

Below are some Recommended PHP Books for Beginner, Intermediate and Advanced students.

   

BEGINNER

Head First PHP & MySQL –  Lynn Beighley

 

Head First PHP & MySQL is the good book to start learning building dynamic websites using PHP and MySQL. You can create and populate your own MySQL database tables, and work with data stored in files . Use of exercises quizzes and puzzles turns this series into bestseller. You’ll build sophisticated examples — including a mailing list, a job board, and an online dating site — to help you learn how to harness the power of PHP and MySQL in a variety of contexts.

What you’ll learn

  • Use cookies and sessions to track visitors’ login information and personalize the site for users
  • Protect your data from SQL injection attacks
  • Use regular expressions to validate information on forms
  • Dynamically display text based on session info and create images on the fly
  • Pull syndicated data from other sites using PHP and XML
  • Advanced topics like session IDs, cookies, sessions, form validation, database queries and joins, file I/O operations etc.

BUY NOW

 

PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition) – Larry Ullman 

  • With step-by-step instructions, complete scripts, and expert tips to guide readers, veteran author and database designer Larry Ullman gets right down to business.
  • After grounding readers with separate discussions of first the scripting language (PHP) and then the database program (MySQL), he goes on to cover security, sessions and cookies, and using additional Web tools, with several sections devoted to creating sample applications.
  • This guide is indispensable for beginning to intermediate level Web designers who want to replace their static sites with something dynamic.
  • In this edition, the bulk of the new material covers the latest features and techniques with PHP and MySQL.
  • Also new to this edition are chapters introducing jQuery and object-oriented programming techniques.
  • The contents of current edition of the book were updated to correspond to version 5.3 of PHP and version 5.5 of MySQL.

BUY NOW

 

 

 

Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning Php, Mysql, Javascript, Css & Html5) 4th Edition –  Robin Nixon

 

This book is for people who already have a fundamental understanding of HTML and are looking to create effective and dynamic websites, such as graphic designers who are already creating static websites but wish to take their skills to the next level, as well as high school and college students, recent graduates, and self-taught individuals. It provides a thorough grounding on core technologies such as PHP, MySQL, JavaScript, CSS, and HTML5, and jQuery library.

This book will help you:
-Understand PHP essentials and the basics of object-oriented programming
-Master MySQL, from database structure to complex queries
-Create web pages with PHP and MySQL by integrating forms and other HTML features
-Make Ajax calls and turn your website into a highly dynamic environment
-Upload and manipulate files and images, validate user input, and secure your applications

BUY NOW

 

 

INTERMEDIATE

PHP & MySQL For Dummies –  Janet Valade

 

Using this book , you can build a online catalog and members only interactive website.

You’ll learn :

  • Get familiar with the terms PHP , MySQL
  • Their installation.
  • Store data in your database and query it via PHP and display it on your Website
  • Build PHP scripts that uses up to date code.
  • See how the language and database work together to produce dynamic Web pages with less hassle.
  • Deliver secure and sound website with proper documentation.

The book is recommended for someone acquainted with nuances of programming but is new to PHP.

BUY NOW

 

 

 

 

PHP & MySQL: Novice to Ninja: The Easy Way to Build Your Own Database Driven Website 5th Edition – Kevin Yank

 

An intermediate level book to speed up your PHP integration with database (MySQL). Through this book, you can get acquainted with best database design and principles.  It contains installation process of PHP, MySQL. Takes on an explanatory approach and helps you build your first database. Working example is used in entire book, so that new concepts learnt can be incorporated practically.  You will be creating a live web based Content Management System and a functional e-commerce system.

What’s new ?

  • Up to date: Updated for Windows 7, Mac OS X Lion, and the latest versions of PHP, MySQL, phpMyAdmin, XAMPP and MAMP.
  • Latest edition of book recommends using all-in-one installation packages like XAMPP and MAMP, and moves the brittle manual setup instructions to an appendix at the end of the book.
  • Uses the more robust and portable PHP Data Objects (PDO) API and prepared statements to work with MySQL.
  • Easy-to-read HTML5 markup is used.
  • Object oriented programming (OOP) primer is introduced

BUY NOW

 

 

 

ADVANCED

 

Advanced PHP Programming – George Schlossnagle

The rapid maturation of PHP has created a skeptical population of users from more traditional “enterprise” languages who question the readiness and ability of PHP to scale, as well as a large population of PHP developers without formal computer science backgrounds who have learned through the hands-on experimentation while developing small and midsize applications in PHP. While there are many books on learning PHP and developing small applications with it, there is a serious lack of information on “scaling” PHP for large-scale, business-critical systems.

Schlossnagle’s Advanced PHP Programming fills that void, demonstrating that PHP is ready for enterprise Web applications by showing the reader how to develop PHP-based applications for maximum performance, stability, and extensibility.

The book covers a variety of advanced topics such as design patterns, error handling, templates, unit testing, caching, databases, performance tuning and extending the language.

 BUY NOW

 

 

 

PHP Objects, Patterns, and Practice – Matt Zandstra

 

PHP Objects, Patterns, and Practice shows you how to blend the power of PHP with the sound enterprise development techniques embraced by professional programmers. It goes beyond the basic programming and will elucidate advanced topics such as working with static methods and properties, abstract classes, interfaces, design patterns, exception handling, and more.

You’ll learn to

  • Write solid, maintainable code by embracing object oriented techniques and design patterns.
  • Create detailed, versatile documentation using the powerful phpDocumentor automated documentation system.
  • Gain new flexibility during the development process by managing your code within a CVS repository.

BUY NOW

 

31
Jul

Getting Familiar with Microsoft HOLOLENS

 

 

Ever since the launch of Microsoft Hololens at inception of 2015, it has continued to amaze the world. The proposed capabilities of cool looking device had left people in awe.

What is Hololens?

It is world’s first holographic head mounted display based on the concept of Augment Reality or rather, Mixed Reality. It lets you interact with holograms within an environment such as your room, providing a truly  immersive experience.

Once you wear the device , your visual world will be over laid by a digital one, without loosing sight of original. The device has high-end sensors and trackers that detect your eye position , capture your hand movements , record and respond to your voice. For starters, you can watch videos , check blogs , open documents. It scans your view and objects and marks them as reference whenever required. You can see a new 3D world in front of you.

   

 

According to excerpt from official Microsoft site , Interacting with holograms in mixed reality enables you to visualize and work with your digital content as part of your real world. Realize mixed reality’s promise with Microsoft HoloLens.

 

Launch

Hololens was introduced at Windows 10 launch event earlier in 2015.

Below is a demo video from Build 2015. The demonstration was really interesting and new.

 

At Build 2017 , Hololens got re-introduced as it gets Motion controllers.

Price and availability

Hololens is currently available in developer version only and comes at a whooping price of $3000. A version for the masses is yet to hit the grounds.

Applications of Hololens

1. Remote Instruction

Hololens could be used for Remote Instruction purposes. Visual diagrams or models could be seen in space around the user indicating exactly what you need to do next. 

 

2. Entertainment

 

One of the most fascinating use of Hololens is Gaming. It could provide gaming experience like never before. Having a 3D immersive gaming experience at comforts of your home would be amazing.

 

3. Gaming

Hololens could bring virtual objects into real by overlaying them and hence, makes a great potential for Entertainment business. Users can climb mountains , explore space, go deep-sea diving , host an alien war right at their couch.

 

4. Training

 

NASA is also using Microsoft’s HoloLens to “travel” to Mars.  They hope to be able to use the technology to control future rovers and virtually explore the land around the rovers. 

 

5. Designing

 

Designing is another major area that could make use of Hololens. The device can scan an object, help you design it the way you prefer and you can watch your ideas coming to life.

 

 

HOLOLENS SPECS

 

 

 

Along with the traditional CPU (Central Processing Unit)and GPU (Graphic processing unit), it features Holographic processing unit or HPU, dedicated to immerse holograms in real environment.

Other specificatins include:

  • 2GB RAM
  • 64 GB Flash storage
  • Custom Microsoft Holographic Processing Unit HPU 1.0, Intel 32-bit architecture
  • Multiple environment understanding sensors , ambient light sensor and inertial measurement unit
  • See through holographic lens display with Automatic pupillary distance calibration
  • 2 MP HD camera to capture photos and videos
  • Bluetooth and Wi-Fi connectivity
  • Weighs 579g
  • External speakers, 3.5mm audio jack
  • Charges over micro USB giving 2-3 hour active use battery life
  • Runs windows 10

 

HOLOLENS INTERACTION

 

In order to allow the human interaction, 3 features are executed :

  • Tracking Gaze
  • Taking input via Gesture
  • Providing Voice support.

 

 

  • Gaze helps the device to understand the what to give information about.
  • It is equivalent to setting target. Whatever you are looking at via digital screen, Hololens understands  you are paying attention to it at the moment.
  • Once you have your item of interest locked in your gaze , you can now provide input via voice or gestures.
  • For gesture , it could be an action , such as “tap”.
  • For voice, this is done by utilizing array microphones that provides excellent voice recognition.

Comment and share this post if you like it and want us to add more posts like this.

 

31
Jul

Top 9 Augmented Reality Applications

 Top 9 Augmented Reality Android and iOS Applications

 

Theodolite

Theodolite AR App

Theodolite AR App

  • Using this app, an age-old surveying instrument, called Theodolite used to measure angles, distances, directions and locations, is digitized.
  • Theodolite is a multi-function viewfinder that combines a compass, two-axis inclinometer, rangefinder, GPS, map, navigation calculator, tracker, and geo-tag photo/movie camera into one indispensable app.
  • It comes with an optional in-app purchase to enable team tracking, with which you can share location with up to 20 people on Theodolite’s map. This was aimed at helping search and rescue teams.
  • You can download the app from appstore here.

 

Google Translate

Google Translate AR App

Google Translate AR App

  • Users can now point their device, with the app installed, towards text in unknown languages.
  • The text can be a part of newspaper and road signs as well.
  • The letters rearrange themselves on the screen to convert into a language of user’s choice.
  • They can select  from over 30 languages available.
  • You can download this app for iOS here and for android here.

 

 

WikiTude World Browser

WikiTude World Browser AR App

WikiTude World Browser AR App

  • You can now point your camera phone and look around via it to find nearby restaurants,ATMs, landmarks and other significant locations.
  • These are particularly, very helpful when you visit a new city or country.
  • Once, you scan surroundings, a list of categories to browse through is presented.
  • Social networks are also included, so you can find a friend in vicinity.
  • Download the app here.

 

 

LayAR

LayAR AR App

LayAR AR App

  • With LayAR , you can easily find services around you.
  • The app uses their meta data to enable the user to click on the icons which pop up when in AR mode to view more information.
  • If one clicks on a hotel they’ll get a description, customer reviews and prices as well as a link to their booking site.
  • You can download the app for iOS here and for android here.

 

 

Augmented Car Finder

Augmented Car Finder AR App

Augmented Car Finder AR App

  • It uses AR , 3D Google maps and radar to keep track of your parked vehicle.
  • It uses your camera to search for your vehicle and give you directions to it.
  • Not just that, it also has Auto track mode to locate car if it gets stolen.
  • It can manage upto 3 cars.
  • Also, have parking meter alarms.
  • Download here for iOS.

 

SpecTrek

SpecTrek AR App

SpecTrek AR App

  • It is a fun, ghost hunting game, which requires a camera phone and GPS.
  • Using SpecTrek app, you can move your camera around and virtual ghosts will appear nearby.
  • You can then, catch those ghosts by some ghost-busting options that appear on screen.
  • Download here for android and here for iOS.

 

 

Color Grab

Color Grab AR App

Color Grab AR App

 

  • This app is useful for people with artistic bent.
  • You can launch app and point it to desired object.
  • It lets you capture any new color that you witness and store it for later use. It records the RGB and hex values of the color.
  • You can also share them.
  • Graphic designers could put it to good use.
  • Download here for android.

 

 

Science AR apps

Science AR apps

Science AR apps

  • This is a educational app for elementary school kids.
  • This app works in conjunction with Science AR posters. When the screen of device is pointed towards the AR poster, digital contents  like video and graphics is played to make learning fun.
  • The posters have be downloaded separately.
  • Download here for iOS.

 

 

Augment

Augment AR App

Augment AR App

  • Augment app is an enterprise AR platform used by ecommerce sites.
  • It allows their users to test, how a product will look like at their home or desired location visually in actual dimensions.
  • The product could be an almirah , a pair of shoes , a chair or any other complex or simple object.
  • Download here for android and here for iOS.

Comment and share this post if you like it and want us to add more posts like this.

18
Jun

How to Get Code Coverage with Jacoco and Espresso

How to Get Code Coverage with Jacoco and Espresso


Finding code coverage is very important for testing because it allows you to measure your testing efforts. If you have a test suite prepared for your application but you are not sure test suite covers how much percentage of code then finding the code coverage will be good practice Once you get the coverage report, you will know exactly what part of code is not covered in your test case and then you can add test cases to cover the code.

Jacoco is java code coverage tool which allows you to calculate code coverage for your unit tests and instrumented tests. Jacoco can be used with Ant, Maven & Gradle build tools. Today, I will show you step by step integration of Jacoco with Gradle for Espresso test suite.


I have done this setup for Simple Hello world project to give idea of how Jacoco works and gives proper code coverage report.

Pre-requisite –

  • Android Studio
  • Junit
  • Espresso Setup
  • Espresso Test Case written as per our previous post for “Hello Word”

How to Setup Jacoco and Get Coverage ?

    • Create an android project as shown in my previous post.
    • Create a java class inside src->main->androidTest and write your Espresso test case in the class
    • Create a new class named AndroidJococoTestRunner in src -> main ->androidTest and copy below code inside the class.
    • Open app-> build.gradle and copy below code in defaultConfig.
 

    • Then click on Gradle on right side of Android studio -> click on refresh -> other -> right click on createDebugAndroidTestCoverageReport -> click on run

 

    • This action will run all the test cases inside src->main->androidTest and give the report in app->build-> reports ->coverage -> debug.
    • pen index.html file in the browser to check the code coverage report as shown in below screenshot.

Jacoco_Code_Coverage1

 

 






20
Feb

Writing Effective Business Emails

In this post of Writing Effective Business Emails, we will be covering following:

Addressing:

  • Limit to who really needs to know.
  • Make it clear in text who has action and who is info addressee.
  • Use BCC to protect Email addresses unless everyone knows each other.
  • Watch Reply All.
  • Use address book & validate often.
    • Avoid typing addresses free hand; many addresses are similar; watch auto fill.
    • Send same message to multiple recipients by editing message as new or cutting and pasting.
  • Make sure forward does not embarrass sender.
    • Get permission if in doubt.
    • Never “disrespect” sender in forward or reply.
  • Fill in addresses last to avoid sending an incomplete Email by mistake.

Subject Line:

  • Headline (think newspaper).
  • Grab Attention.
  • Summarize message.
  • Make it easy for recipients to triage your Email and find it later.
  • Don’t “Reply All” to a message to grab addressees without changing subject.

Opening Lines:

  • With reference to your letter of 8 June, I …
  • I am writing to enquire about …
  • After having seen your advertisement in … , I would like …
  • After having received your address from … ,I …
  • Could you please help me with the following…..
  • This is to inform you that…..

Closing Lines:

  • If you require any further information, feel free to contact me.
  • Please let me know in case any other information is required.
  • I look forward to your reply.
  • I look forward to hearing from you.
  • I look forward to seeing you.
  • Please advise as necessary.

Message Text:

  • Keep the message focused and readable.
  • Keep it short.
  • Break into paragraphs; skip lines between.
  • Use short sentences.
  • Use plain text editor, not MS Word.
  • Avoid HTML.
  • Avoid fancy typefaces.
  • Write in standard professional English with Capitalization and correct spelling.
    • Don’t try to impress.
    • Avoid chat speak, e.g., gr8 & emoticons, J.
  • Don’t type in All Caps
  • Avoid !!!
    • Avoid using URGENT and IMPORTANT.
  • Use * * to highlight text if you need.
  • Proofread & Spell check.
  • Quote back selectively when replying to long messages.
    • “Yes, I agree.” is useless without context.
    • Top quote vs. bottom quote – no consensus.
    • Avoid “Fisking,” replying line by line in an argumentative manner.
  • For URL links, use Outlook inbuilt function to shorten long URLs or enclose in < >.
  • Identify yourself clearly to new contacts.
    • Hello, I am… The reason I am writing…
    • Hello, so-in-so suggested I contact you…
  • Respond Promptly.
    • Apologize if you aren’t able to reply promptly.
    • Interim reply when too busy.

Attachments:

  • Cut and paste relevant parts of attachment into text of Email.
  • Upload attachments to shared location / sharepoint and use URL links.
  • Recipients who do not know you, may be reluctant to open attachments or click URLs.
  • Ensure you insert attachment to avoid sending emails like “Oops, here’s the attachment.”
  • Post large attachments in a blog (if any) and then send an Email announcement.

Signature Line:

  • Include (For receivers information)
    • Your name
    • Title
    • Organization
    • Email address
    • Website / Blog
    • Phones
  • Can be shortened for frequent correspondents.

Confidentiality and Security:

  • Have a separate Email account for newsletters, announcements etc.
  • Delete browser history, cache, cookies, userids and passwords after using a public Internet connection.
  • Logout and close all Apps after using a public Internet connection. (Restart if possible.)
  • Don’t open company emails on non-secure personal computer.
  • Back up your Email.
  • Beware of spam.
  • Beware of Phishing attacks.
  • Never include personal or financial info in an Email.
  • Don’t unsubscribe from anything, you did not subscribe to.
  • Beware of friend’s Emails.

Using Outlook:

  • Organize Email into folders.
  • Keep a copy of all sent Emails.
  • Review and clean out folders periodically.
  • Don’t print Emails unless its important.
  • Use “out of office” status when away.

10 common Email habits that waste time and cause problems:

  • Vague or nonexistent subject line.
  • Changed the topic without changing the subject.
  • Including multiple subjects in one note.
  • Sending before thinking.
  • Inadvertent replying to all.
  • Omitting the context of a reply.
  • Misaddressed recipients.
  • Displaying addresses of recipients who are strangers to each other.
  • Replying vs. forwarding.

Points to Remember:

  • Write a meaningful subject line.
  • Keep the message focused.
  • Avoid attachments.
  • Identify yourself clearly.
  • Be kind — don’t flame.
  • Don’t assume privacy.
  • Distinguish between formal and informal situations.
  • Respond Promptly.
  • Show Respect and Restraint.

Latest Posts

13
Feb

Requirement Traceability Matrix – RTM

In this article, we will be covering following:

What is Requirement Traceability Matrix (RTM)?

  • RTM is a document that links requirements throughout the process of validation .
  • It is to ensure that all requirements defined for a software are tested.
  • It is a tool for the validation team to make sure that requirements are met during the validation of a software.
  • Matrix is created at the beginning of project on the basis of the project’s scope and deliverable’s.
  • It is bi-directional, as it tracks the requirement forward by examining the output of deliverable’s & backward by looking at the business requirement that was specified for a particular feature of the product.

Requirement Traceability Matrix – Parameters:

  • Requirement ID
  • Requirement Type (BRD and FSD)
  • Risk
  • Test Scenario ID
  • Test Case ID
  • Status
  • Defects ID

 

How to Create a Matrix?

Requirement Phase

QA Team start writing Test Scenarios & eventually Test Cases based on some input documents – Business Requirements Document (BRD), Functional Specification Document (FSD) and Technical Design Document (optional).

Ex:- BRD & FSD

BRD FSD
BRD

BRD

FSD

FSD

Design Phase

Based on the two input documents, below is the list of high-level scenarios to test:

TestScenarios_BRD

TestScenarios_BRD

For each Test Scenario, you are going to have at least 1 or more Test Cases. So, include another column and write the Test Case IDs as shows below:

BRD_TC

BRD_TC

At this stage, Traceability Matrix can be used to find gaps. For example, you see that there are no test cases written for FSD section 1.2 in the above Traceability Matrix.

As a general rule, any empty spaces in the Traceability Matrix are potential areas for investigation. So a gap like this can mean one of the two things:

  • The test team has somehow missed considering the “Existing user” functionality.
  • The “Existing user” functionality has been deferred to later or removed from the application’s functionality requirements.

If it is scenario 1, it will indicate the places where test team needs to work more to ensure 100% coverage. In scenario 2, TM not just show gaps it also points to incorrect documentation that needs immediate correction.

Execution Phase

Let us now expand the TM to include test case execution status and defects.

The below version of the Traceability Matrix is generally prepared during or after test execution:

BRD_Status

BRD_Status

 

Latest Posts

10
Feb

Difference Between Test Cases and Test Scenarios

This article isn’t only going to cover Test Cases Vs Test Scenarios but it will cover following:

Few years back, when I was working in an MNC and dealing with a testing project, I suggested my colleagues to document the test Scenarios instead of test cases. Can you imagine, their reaction amazed me as they all were staring at me all together, I could not argue. It was like I have made a big mistake in my life. Everyone’s opinion was same except mine. They prefer to follow the traditional method of writing Test Cases and not Test Scenarios. Those who are newbies in this field might get confuse with the word Test Scenarios and Test Cases. This article will clear all doubts about it by giving real time examples and explanation.

Few years later, I Switched to another company and handled a testing project which was based on searching and generating different reports with the help of different menu options. We in a team were discussing about the project and how we can proceed with that? Actually, client wanted that project early and we were having deadline to complete the project. Considering my last experience about suggesting the documentation of Test Scenarios, I kept quiet and thinking of other idea. Suddenly, one of my colleagues raised his voice that “We should prepare Test Scenarios in a document”. This time, everyone was quite satisfied with his idea and we further started preparing the Test Scenarios. The conclusion of both cases suggests that preparing the Test Scenarios and Test Cases depends on the urgency and requirement of the project. Generally, in companies, test cases are prepared rather than documenting test scenarios.

Test Cases are replaced with Test Scenarios

As we all know nothing is permanent and with this concept, the software industries and their processes are also changing with time and cost constrains.

V-models and waterfall models which are considered to be traditional models are being replaced by iterative and agile models. In every testing project, document is indeed essential but to complete the project fast within the deadline and to make the process transparent and easy, the way of documentation is changed these days.

Following conditions are applicable for documenting Test Cases:

  1. Client may ask for the same as part of his project
  2. No Time constrain(But, I don’t think, it’s possible)
  3. When software testers are fresher and new to the product.
  4. When there is Company policy (I strongly have faith that it can be altered)

One of my experience will give you clear picture.

I was handling one of the testing projects from fortune 500 company and they didn’t give us any deadline to complete the project. That mean we were having flexible timelines to complete the project. We were already having template of test cases, and with the help of that we prepared the test cases and it got approved from client as well.

Once the development team finished their module, they were giving us to test it and most of our duty was to follow 100 test cases in a day. We used to document with pass/fail result, further sending it to the client at the end of the day. The project was really big and had different modules within it. To do the same process of documenting the test cases was a monotonous work for some of my colleagues. But at the end of the day, the company was generating revenue from it.

During the project, we had one break where we were not having any task of documenting the test cases. We were having a good time and I was discussing about new ideas and techniques so as make improvement in the existing test cases. I have found during that discussion that none of my colleague was interested in implementing those new ideas and techniques as they thought all the test scenarios is been covered already while making huge amount of test cases. No one was really interested in putting the efforts for new techniques as it a human mentality that we do not want to rework once the work is done. Our mind automatically stops making any efforts for any new ways and techniques for the past work. Same had happened with my colleagues and they just wanted to relax on that certain day.

It is also a fact that in IT companies, most of the testers follow the mechanical process of making the test case and no one really makes effort to make additional test case for the existing one? The same might have also happened with you, if I am not wrong.

Another experience:

While extensively involved in a team challenge activity, we were having a discussion and asked the team members to prepare the test scenarios for the product. We have all started to make the test scenarios and there was not a specific document where we would literally fill expected result and pre-condition for each test case. At the end of the day, we have collected almost 50 test scenarios and it was indeed a great experience while proceeding with that project.

Below example will make picture more clear:

Assume that you are having your website and it has features like username, password, and login page along with cancel button. If you were asked to write the test cases for the above features then your test case may exceed 50 and if you would ask to write the test scenarios, then it will be just a matter of lines. Below explanation will give you the exact idea about test scenario.

High Level Scenario:   Login Functionality
Low Level Scenarios:

  1. To check Application is Launching
    2. To check contents text on login page
    3. To check Username field
    4. To check Password field
    5. To check cancel button and Login Button functionality

As we all are at short of time, test scenarios just acts as pain killer spray rather than that old time IODEX. And still the effect is same in both the case.

Finally, I would like to summarize difference as below:

 

Test Cases

Test Scenarios

What it is => A concept which offers complete info what to test, steps to be taken and expected result of the same A concept which offers one-line info about what to test.
It’s about => It’s more about documenting particulars. It’s more about rational and conversing particulars.
Importance => It’s significant when testing is off shored and development is onsite. Writing test cases with particulars will aid both dev and QA team in sync. It’s significant when time is less and most of the team members can agree / appreciate the details from one-liner scenario.
Advantage => One time documentation of all the test cases is helpful to track 1000s rounds of regression testing in future.
Most of the time, it is helpful while bug reporting. Tester just need to give reference of test case ID and does not require mentioning each and every minute detail.
A time saver and idea generation activity, favoured by new generation software testing community.
Modification and addition is simple and not specific to a person.
For a huge project, where group of people know specific modules only, this activity gives a chance to everybody to look into other modules and brain storm and deliberate.
Beneficial to => A full-proof test case document is a life line for new tester. Good test coverage can be attained by dividing application in test scenarios and it decreases repeatability and complexity of product
Disadvantage => Time and money consuming as it requires more resources to detail out everything about what to test and how to test If created by exact person, the reviewer or the other user might not sync the precise idea behind it. Need more discussions and team efforts.


Conclusion of this Post:

Test cases are most significant part of Software Testing Life Cycle which is also referred as STLC. With its absence, it’s tough to understand, track, follow and reason out something. But in the era of Agile, test cases are being substituted fast with test scenarios.

Database testing, GUI testing, functionality testing has the common test checklist which is coupled with modern artillery and test scenarios. With participation in trainings, Discussions, questions and practice one can definitely learn and change the final graph of Bug report matrix and your productivity.

Latest Posts

8
Feb

Tips for Salary Negotiation

Salary Negotiation is itself an art and this article will help you to engage few important points to consider while negotiating salary.

You need to be very smart while negotiating your salary. It is easier to say yes for the job, but when it comes to negotiating your salary then all the scenario changes suddenly. That’s why it is indeed essential that you know the tactics of it hence gaining satisfaction for the work that you will accomplish.

You need to impress your hiring manager by showing him your value gracefully. This might impress him while changing his mind to raise your salary. There are chances that your hiring manager may not change his mind at all, but that is absolutely fine as it is always good to raise your voice, hence adding value to personality. It will also show that you are taking this position seriously. If company goes through the whole recruiting-interviewing-hiring process again, chances are more that they spend huge cost, compared to previous scenario in the long run.

Salary Negotiation Tactics

Let’s take a simple example to make you understand more about Salary Negotiation and the tactics involved in it. Assume that you are selling your old car and the buyer asks you “What is the best price you have kept on this car?” You answer him by saying $9000 and the buyer quickly says agreed, sold it. Huh! This is the point when you start doubting yourself and feel that you might have offered very less value to the car. You might think that you would have increased the price with more dollars. Moreover, if the buyer asks you, “Don’t you think the price is too high, for this car?” then you firmly answer him “I have done my homework perfectly and this is the best price the car deserves”. At the end of the talk, the buyer finally agrees and pays for the asked price. This also gives you winning the conversation feeling, further gaining worth for sticking to your guns. Well, getting the big difference here?

The same happens while negotiating your salary in front of hiring manager. If you came to know that the company needs resource in their current project and they are looking for you as their potential employee, then it’s time for you to keep your worth. Have a discussion with your hiring manager at proper situation and tell him that you are beyond your midpoint level and need a boost in your salary so as it will keep you motivated. Tell him you are getting less salary then your peers, in spite of being such an incredible resource. Keep in mind that you need to be very polite and say this in very joking manner so that the hiring manager notices your perspective while not taking any negative out of it.

One tester from our Testing Community have applied same tactics in his current company and got a bonus of $5000 in base salary that finally benefitted him in the long run.

Have Courage

Having courage doesn’t mean you have to directly ask your employer about salary at first instance. Have patience first and see that you clear the pre-screening process and first round of interview. After that when you are being called for the second or final round of interview that time pay attention to the intention of the employer and what he is trying to convey you. Based on his question, answer smartly while keeping value of yourself. Believe in yourself and ask what you deserve. Do not hesitate for asking the value which you deserve the most. Have some courage while asking and negotiating the same.

Following questions and answers will help you in this.

Employer: Mr. John, what salary are you looking for?”

Candidate: Well, I am here for two reasons. Firstly, this company is excellent and always beyond in every aspect. Working here will definitely enhance my skills and confidence. Secondly, I will have a secure job. I have researched for this position and as per my knowledge, the salary offered for this role is around $65000-$70000. I would love to have salary in such range.

Employer:” We are impressed with your credentials and what salary would you expect for this position?”

Candidate: I am flattered to hear this and would like to work with this company. We will definitely work together and give our best. Currently, I am earning $65000 and primarily looking for at least $70000 as a base salary.

Tips for Negotiating Salary:

  • Don’t ask for salary unless employer asks you
  • Ask for benefits packages when answering for salary
  • Research well before applying for position
  • Don’t discuss salary over telephone
  • Keep in mind what salary you are worth for
  • Never underestimate your worth
  • Have patience and self-confidence

 

Latest Posts

6
Feb

How to Report or Log Bugs?

Following sample bug/defect report will give you precise clue of how to log bugs in a bug tracking tool. You can use any bug tracking tool for tracking the bug for your reference.

Below is the sample scenario which caused the bug:

Let’s say you have built a new application. Now, you want to create a new user with new information in the application. To achieve this, you should login and then navigate to USERS menu>New User and under that fill all the required details such as First Name, Last Name, Address, Age, Phone etc. After entering all the details you should save that info by clicking SAVE button. After this, you will get the message “New User has been created successfully”. This is the exact process that you should follow for creating new user in your website.

Log in and then navigating to USERS menu > New User you save all the info by clicking the SAVE button and BANG! You get an error message and system suddenly crashes down. At that moment, you should save that error message by capturing it and saving it into Microsoft paint file or wherever you feel comfortable.

This is actually a Bug scenario for a tester and he now needs to log that BUG into bug tracking tool. Different tools are used for tracking the BUG and some of them are JIRA, Bugzilla, IBM Rational Clear Quest etc.

How the bug is reported effectively in bug tracking tool?

Below is the sample bug report for above stated example :
(Note : ‘bug report’ fields vary depending on Bug Tracking Tool)

SAMPLE BUG REPORT:

Bug Name: Application crashed while clicking the SAVE button for creating a new user.
Bug ID: (It will be automatically created by the BUG Tracking tool once you save this bug)
Area Path: USERS menu > New Users
Build Number: Version Number 3.0.4
Severity: HIGH (High/Medium/Low) or 1
Priority: HIGH (High/Medium/Low) or 1
Assigned to: Developer-X
Reported By: Your Name
Reported On: Date
Reason: Defect
Status: New/Open/Active (Depends on the Tool you are using)
Environment: Windows 10/SQL Server 2008

Description :
Application crashed on clicking SAVE button for creating a new user, henceforth not able to create a new user in the application.

Steps To Reproduce:
1) Logon into the application
2) Navigate to the Users Menu > New User
3) Filled all the user information fields
4) Clicked on ‘Save’ button
5) Seen an error page “OWX847 Exception: Insert values Error…”
6) See the attached logs for more information (Attach more logs related to bug.. IF any)
7) And also see the attached screenshot of the error page.

Expected result: On clicking SAVE button, it should give a success message “New User has been created successfully”.

(Attach ‘application crash’ screen shot. IF any)

Save the defect/bug in the BUG TRACKING TOOL which you are using.  There, you will get a bug id that can be used further as a Bug reference.

Default ‘New bug’ mail will go to particular developer and the default module owner (Team leader or manager) for further action.

Latest Posts

 

1
Feb

Project Estimation Rules

Below Project Estimation Rules should be recalled when doing Estimation of a Testing Project: 

 

1st Rule: Software requirements are considered for Estimation

Software requirements are indeed essential for test estimation as it is based completely on what would be tested. The development team has much involvement in the software requirements as compared to the testing team and the requirements are mostly established by the development team. When all the estimation are done related to the project cost, duration of the project then the development team asks the testing team that how much time will be required by them in order to complete the testing of the application. The answer given by the testing team is considered for the SDLC process.

Testing team plays a vital role in estimation of the project because testing is an essential part of SDLC. Testing application, one can deliver a bug free application to the client.

2nd Rule: Expert judgment matters for the Estimation of the Project

The testing team classifies the requirements before estimating them in the following categories:

  • Critical: The development team has slight knowledge in how to implement it;
  • High: The development team has worthy knowledge in how to implement it but the task is not easy at all;
  • Normal: The development team has decent knowledge in how to implement. 

The expert opinion in each requirement suggests how long it would take for testing them.  The categories would eventually help the experts in estimating the effort for testing the requirements.

3rd Rule: Previous projects matter most for Estimation of project

Previous project knowledge and experience are used for the estimation of the project. If new project is introduced then its estimation is based on similar projects which have been executed previously. 

4th Rule: Metrics Helps in Estimation

Organization should create an Organization Process Database which is also referred as OPD, where the project metrics are recorded and referred for future projects.

5th Rule: The past should never be ignored while doing Estimation

Spreadsheets and Old process is still used by the testing team in order to estimate the project completely. If new rules are introduced during the process then the testing team follows that and at the same time compares the old process too so as to get complete idea in test Estimation.

The results which come from the new estimate process should be faster and cheaper as compared to the old process and in percentage of 20 to 20%. If different percentage are measured by the testing team then they go back to the old process to check whether they are missing something during the process or not.

 6th Rule: Recording of Estimation is indeed essential

During testing of the process all the results should be recorded in order to refer it for future projects. It is also beneficial when requirements of the projects change and hence the recording will eventually help the testing members in estimating the project. This will help testing team to not return all the steps again and will further help in taking same decisions. It also gives the opportunity to test the estimation before making any changes to it. 

7th Rule: Tools should be used while doing Estimation

A spreadsheet containing metrics eventually helps reaching the estimation as quickly as possible. The spreadsheet will calculate it automatically hence giving ease to the team members. It also helps in tracking the duration and time of the projects. 

Risk Table, and free notes should be included in the template and need to be filled in the tool. These tools also help in showing different options for testing which actually aids the customer in deciding which types of test he needs practically.

8th Rule: Estimation should continuously be verified

All estimation should be verified in a certain period of time.  Along with this, another spreadsheet for recording the estimations should be created.  The estimation is compared to the previous ones recorded in a spreadsheet so as to see if they have similar trend.  If the estimation has any deviance from the recorded ones, then it is indeed essential to a re-estimation of the entire project.

9th Rule: Risk factors should be covered in Estimation

Product down time, resource unavailability, skill improvement and learning capability are some of the risks that should be covered in test estimation.

Scenario for an Estimation:

Assume you have a project and you have estimated that it will take a 10 person team 300 days to complete. (3000 workdays – Sunny day scenario)

Knowing that there are 365 working days in a year (52 weeks x 5 days), without holidays, means that the project, at best, will take 1.13 years or 13.6 months to complete.

Suppose the average year includes 12 days company holidays (total impact = 12×10 people = 120 daysx1.13years = 136 days) and average employee takes 4 sick days and 3 comp days off a year (total impact = 7 x 10 people = 70 x 1.13 = 79)

Average employee takes 7 work days of vacation a year (total impact = 7 x 10 people = 70 x 1.13 = 79)

Suppose also that each employee drops 3 days out of each year for training (30 days)

Total duration change due to employee holidays, sick time, vacation and training = 136+79+79+30=324

Total workdays for the project is now 3000+324 = 3324 or a 10.8% increase in duration (300 day schedule is now 333 days or 15.1 months.)

Latest Posts

31
Jan

Project Estimation Techniques

If you want to be successful in Project Test Estimation then you should have execution knowledge which is eventually very significant in Software Testing Life Cycle. Software Test Estimation Techniques are indeed essential to make good reputation with your client when you bid for testing projects. It also gives you idea that how your approach should be during the execution of the project.

In case, you have experience in various software testing life cycle then chances are higher that you estimate your project very well as your experience may help you in providing various ideas & techniques for that testing project. It is practically not possible to put some number of days or estimate with old time formula of one third of the development effort. The requirement keeps on changing from client side & we have to adjust the same accordingly. Some companies which offer testing services use this formula which isn’t correct as it is not based on any scientific techniques or principles.

Following factors are indeed essential for any software test estimation and they are highly recommended in any software testing organization.

  • Team Knowledge on the subject/skills
  • Historical data for the previous estimation for improvement and accuracy
  • Domain Knowledge and core requirements
  • Risks and complexity of the application
  • Team Knowledge on the subject/skills
  • Bug cycles for the project
  • Estimation should include buffer time
  • Resources availability (Like vacations, holidays, and sick days can have a great impact on your estimates)
  • Bug cycles for the project

Many techniques are used in recent years that have been developed for test estimation of the software.

Some of the Estimation Techniques are:

 Following are the popular Test Estimation Techniques:-

Use – Case Point Method:

Use-Case Point Method is completely based on the use cases that we calculate the un-adjusted actor weights to determine the software test estimation.

Use case is a document which well specifies systems, different users or other stakeholders that interact with the concerned application. They are certainly named as ‘Actors’. The interactions achieve some defined goals hence protecting the interest of all stakeholders via flow termed or different behavior as scenarios. 

The formula used for this technique is:

  • Unadjusted actor weights = total no. of actors (positive, negative and exceptional)
  • Unadjusted use case weight = total no. of use cases.
  • Unadjusted use case point = Unadjusted actor weights + Unadjusted use case weight
  • Determine the technical/environmental factor (TEF) ( if not available take as 0.50)
  • Adjusted use case point = Unadjusted use case point * [0.65+ (0.01 * TEF]
  • Total Effort = Adjusted use case point * 2

3-Point Software Testing Estimation Technique:

3-Point Software Testing Estimation Technique is completely based on statistical methods where each testing task is broken down into sub tasks and further into three types on each tasks.

The formula used by this technique is:

Test Estimate = P + (4*N) + E / 6

Whereas P = Positive Scenarios or Optimistic Estimate (Best case scenario in which nothing goes wrong and all conditions are optimal.)

N = Negative Scenarios or Most Likely Estimate (most likely duration and there may be some problem but most of the things will go right.)

E = Exceptional Scenarios or Pessimistic Estimate (worst case scenario which everything goes wrong.)

Standard deviation for the technique is calculated as,

Standard Deviation (SD) = (N – E)/6

Work Breakdown Structure:

This method is created by breaking down the test project into small pieces. Modules are separated into sub-modules. Sub modules are then further separated into functionalities and functionalities are then separated in sub-functionalities.

You should review all the requirements from Requirement Document so as to make sure that they are added in WBS. Later, figure out the number of tasks your team needs to complete. Estimate properly the duration of each task.

Wideband Delphi Estimation Technique:

Following the same procedure as above in WBS. In this, work breakdown structure is disintegrated for each task and further distributed to a team comprising of say 3-7 members so as to re-estimate the task. The final estimate is the consequence of the brief estimates that are based on the team consensus. This method actually speaks more on experience instead of any statistical formula. Moreover, this method is initially popularized by Barry Boehm to emphasize on the group iteration so as to reach to a consensus where the team visualize on the different aspects of problems whereas estimating the test effort.

Function Point/Testing Point Analysis:

The Function Point technique is a direct pointer of the functionality of software application from the user’s viewpoint. This technique is the most accepted technique that is used to estimate the size of a software project. 

This technique is also a part of TMap. In function point technique, function points are converted into test points. In Test Point analysis, we carry out following:

  • Static Test Points
  • Dynamic Test Points
  • Environmental Factor
  • Control Factor
  • Productivity Factor
  • Primary Test Hours
  • Total Test Hours
  • Control Factors

In Software Testing, estimation is generally based on previously created application prototype or requirement specification document. To calculate FP for a project, some of the major components are required.  

The major components required are:

Unadjusted Data Function Points:

  1. Internal Files
  2. External Interfaces 

Unadjusted Transaction Function Points:

  1. User Inputs
  2. User Outputs & User Inquiries

Capers Jones basic formula: 

Number of Test cases = [Number of Function Points] x 1.2

Total Actual Effort, TAE = (Number of Test cases) * (Percentage of development effort /100) 

This method is used when requirement document or a detailed low level design document is available. Previous data for development and testing & measure of function point is available.

Latest Posts

25
Sep

Website/AngularJS Modules for Automation Practice

Website/AngularJS Modules for Automation Practice

Today, everyone is inclined towards learning automation. Therefore, tester looks for website modules and visits multiple websites for automation practice. To encounter this problem, we have come up with different website modules under one roof. We developed multiple web pages and include all website components which you may get by visiting N number of websites.

You can practice Selenium, QTP, Ranorex etc scripts on this site. Try automating all simple and complex elements mentioned in this page. And if you are able to automate them then I can guarantee that you can automate any type of website.

Below is the table for the same:

websitecomponents_automationtesting

Demo Site for Practice :

http://www.globalsqa.com/demo-site/

Readers might feel that there are many similar websites in the market and we totally agree with that. There is one thing which makes this testing website different from other automation practice websites that is we have covered different type of components for each category. Example : if anyone clicks on AlertBox, you will find multiple type of Alert Boxes for automation practice.

Not only this, we have seen a trend of AngularJS Website these days (It’s a complete JavaScript-based open-source front-end web application framework mainly maintained by Google). Tester started learning Protractor (Protractor is an end-to-end test framework for AngularJS applications) to automate AngularJS Application. It seems difficult to find AngulasJS website because it can’t differentiated by looking at the site. We need to see website source code or need to install some plugin to identify whether a website is developed using AngularJS or not.

Also, it’s difficult to find AngularJS Protractor automation practice website and all modules. We have come up with different AngularJS components and projects so that no one needs to search for these modules or sites. So, learn protractor to automate AngularJS website. Below is the table showing all the AngularJS modules.

AngularJS Projects

AngularJS Protractor Practice Site :

http://www.globalsqa.com/angularjs-protractor-practice-site/

Before starting, please go through the links mentioned above and feel free to use these components.
If you find any bug or face any issue in the website, please send us an email at [email protected]. We will certainly take it on priority. In case, you want to us to add more things or want to share feedback, do write us.