Tuesday, 27 September 2016

Bug Management and Test Management Steps

Mantis Steps:
1. We can report a bug
2. We can set the priority and Serverity of the bug
3. We can assign bug to the developer
4. We can track complete bug activity
5. We can set relationship of the bugs like parent and child
6. We can define status to the bug
7. We can generate HTML report of the bugs.
TestLink Steps:
1. Create a new Project- Done
2. Create a new test plan- Done
3. Create Release/Build under specific test plan- Done
4. Create test suite- Done
5. Create Test Cases under specific  test suite- Done
6. Link Test cases to the release/build- done
7. Create users(Testers)- Done
9. Execute Test cases- Done
10. Check Reports
Manual Test Case Steps:
Heading:
 Client Name,Project Name, Version,Module Name,Browser,Date, Platform,
Details:
Id,Author, Category, Priority, Testing Type, Test Scenario and Test Steps, User Role,
Test Data, Expected Results, Test End State, Tester,Version, Date, Platform, Actual Result,
Status, Remark


Thursday, 22 September 2016

Manual Testing



1.      Error: An Error is a Mistake.
2.      Bug: During Testing of Application When Testing Team Found Actual Result do not match with the expected result.
3.      Defect: Once Project or Product is Release, then during working by Client or their end user if something wrong identified, it is called defect.
4.      Failure: Once Project or Product is Release and more defects are identified by end users then project is known as failure.
5.      Software Testing: Software Testing is process of executing an application with the intent of finding an error.
6.      CMMI Levels:
i)                    Initial
ii)                  Repeatable
iii)                Defined
iv)                Managed
v)                  Optimized
7.      SDLC : Software Development Life Cycle:
i)                    Requirement Gathering:
-          BD Gets the Projects to the company
-          BD Pass the call to BA
-          BA gathers details of requirement from clients.
-          Requirement can be either functional or non- functional.
-          Functional requirement means core functionality of an application.
-          Nonfunctional requirement means overall behavior of application like performance, usability, security, compatibility.
-          BA Prepares BRD.
-          BA sends the document to development team as well as test.
ii)                  Analysis and Planning
-          Define Scope of the project.
-          Feasibility study of the requirement
-          Analyzing risk factors.
-          Effort estimation
-          Cost estimation
-          Deciding programing language of application
-          Preparing gantt chart.
-          Completing the requirement analysis
-          Delimiting the problem domain
iii)                Design
-          Determining which system component will cover which requirement in the system specification.
-          How these system component will work together.
-          Prepares low level design level designs known as prototype or blue print.
-          Prepare high level designs known as DFD, Flowchart, database architecture, algorithms.
-          Description of the Logical data model.
iv)                Development
-          Refining the algorithms for the individual components.
-          Transferring the algorithms into programing languages.
-          Translating the logical data model into a physical one.
-          Compiling and checking the syntactical correctness of the code.
-          Development team starts writing code according to the design prepared by designing team.
v)                  Testing
-          Testing the manual effects of system components under conditions close to reality.
-          Detecting as many errors as possible in the software system.
-          Assuring that the system implementation fulfills the system specification.
-          Perform function and non-function testing against requirement.
vi)                Deployment
-          Product move to production environment for acceptance testing
-          Mainly done by client and their end user
-          Main goal is to check the business flow of the application
-          Correcting errors that are detected during actual operation
vii)              Release
-          Application is published for their end user general public
-          Code is being sent to the website owner.
-          Handover of different document or deliverables to the company.

8.      STLC Life Cycle(Software Testing Life Cycle)
i)                    Requirement Analysis
-          Analysis client requirement in details
-          Deciding testing priorities
-          Checking up automation feasibilities
ii)                  Test Planning
-          Preparation of Test Plan
-          Selection of Testing tools
-          Test effort estimation
-          Resource planning and determining role and responsibilities
-          Training requirement
-          Staffing requirement
-          Define scope of approach
-          Test deliverables: STP (Software Test Plan Document), Gantt chart of Testing.
iii)                Test Case Preparation & Development
-          Create test data for the test cases
-          Development of test cases
-          Approval of test case document
-          Development of automation testing scripts
-          Test deliverables: Preparation Test data, Test case , Test Script Development
iv)                Test Environment Setup
-          Setting up all hardware component
-          Installation of all required software
-          Installation and configuration of testing tools
-          Copying required document
v)                  Test Execution & Bug Reporting
-          Execution of test case
-          Bug reporting to bug tracking system
-          Retesting of the bug after fixes
-          Mapping of bugs with the test cases
-          Test deliverables:  Bug Reporting from bug management tool, updating test case document
vi)                Test Cycle Closure:
-          Submitting STR(Software Test result)
-          Submitting test summary report, test plan document,test case/script etc…
-          Sharing experiences with the team.

-           

Tuesday, 7 July 2015

Date Picker for IOS

View Controller.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@property(nonatomic, strong) IBOutlet UITextField *text2;

@property(nonatomic,strong)IBOutlet UIToolbar *toolbar;

@end




View Controller.m

#import "ViewController.h"

@interface ViewController ()
{
    UIDatePicker *datepicker;
}
@end

@implementation ViewController
@synthesize toolbar;
@synthesize text2;

- (void)viewDidLoad
{
    [super viewDidLoad];

    datepicker = [[UIDatePicker alloc]init];
    datepicker.datePickerMode = UIDatePickerModeDate;
    toolbar = [[UIToolbar alloc] init];
    toolbar.barStyle = UIBarStyleBlackTranslucent;
    [toolbar sizeToFit];
   
   
    UIBarButtonItem *flexibleSpaceLeft = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneClicked:)];
    [toolbar setItems:[NSArray arrayWithObjects:flexibleSpaceLeft, doneButton, nil]];
    text2.inputAccessoryView = toolbar;
   
    text2.inputView = datepicker;
   
}

-(void)doneClicked:(id) sender
{
    NSDateFormatter *formater = [[NSDateFormatter alloc]init];
    [formater setDateFormat:@"dd/MM/yyyy"];
    self.text2.text= [NSString stringWithFormat:@"%@",[formater stringFromDate:datepicker.date]];
    [self.text2 resignFirstResponder];
}
 

Friday, 26 June 2015

MapView With MkAnnotation

ViewController.h

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface ViewController : UIViewController<MKMapViewDelegate>
{
    IBOutlet MKMapView *mapview;
}
- (IBAction)userlocation:(id)sender;

//- (IBAction)backahmedabad:(id)sender;

@end


ViewController.m

#import "ViewController.h"
#import "MkAnnotation.h"

@interface ViewController ()
{
    NSArray *annotations;
}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
   
    mapview.delegate = self;
    mapview.showsUserLocation = YES;
    [self addAnnotations];
   
}

-(void) addAnnotations {
    MkAnnotation *annotation1 = [[MkAnnotation alloc]initWithTitle:@"Nehrunagar" subTitle:@"Ahmedabad" andCoordinates:CLLocationCoordinate2DMake(23.022479000000000000, 72.542987199999970000)];
    annotation1.tag = 1;
   
    MkAnnotation *annotation2 = [[MkAnnotation alloc]initWithTitle:@"Income Tax" subTitle:@"Ahmedabad" andCoordinates:CLLocationCoordinate2DMake(23.039567700000000000, 72.566004499999960000)];
    annotation2.tag = 2;
   
    annotations = @[annotation1,annotation2];
    [mapview addAnnotation:annotation1];
    [mapview showAnnotations:annotations animated:YES];
}

- (MKPinAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    if([annotation isKindOfClass:[MKUserLocation class]]){
        return nil;
    }
    static NSString *identifier = @"identifier";
    MKPinAnnotationView *pinAnnotation = (MKPinAnnotationView *)[mapview dequeueReusableAnnotationViewWithIdentifier:identifier ];
    MkAnnotation *ann = (MkAnnotation *)annotation;
    if(pinAnnotation == nil)
    {
        pinAnnotation = [[MKPinAnnotationView alloc]initWithAnnotation:ann reuseIdentifier:identifier];
    }
    else
        pinAnnotation.annotation = ann;
    if(ann.tag ==1)
    {
        pinAnnotation.pinColor = MKPinAnnotationColorGreen;
    }
    else if(ann.tag == 2){
        pinAnnotation.pinColor = MKPinAnnotationColorPurple;
    }
   
    pinAnnotation.canShowCallout =YES;
    pinAnnotation.draggable = YES;
    return pinAnnotation;
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)userlocation:(id)sender
{
    [mapview setCenterCoordinate:mapview.userLocation.coordinate animated:YES];
}

- (IBAction)backahmedabad:(id)sender {
    MkAnnotation *ann1 = (MkAnnotation *)[annotations firstObject];
    [mapview setCenterCoordinate:ann1.coordinate animated:YES ];
}
@end


MkAnnotation.h

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>

@interface MkAnnotation : NSObject<MKAnnotation>

@property(nonatomic,readwrite)NSInteger *tag;
@property(nonatomic,copy)NSString *title;
@property(nonatomic,copy)NSString *subtitle;
@property(nonatomic,readwrite)CLLocationCoordinate2D coordinate;

-(id)initWithTitle:(NSString *)title subTitle:(NSString *)subTitle andCoordinates:(CLLocationCoordinate2D)coordinate;
@end


MkAnnotation.m

#import "MkAnnotation.h"

@implementation MkAnnotation
@synthesize tag;
@synthesize title = _title;
@synthesize subtitle = _subtitle;
@synthesize coordinate = _coordinate;
-(id)initWithTitle:(NSString *)title subTitle:(NSString *)subTitle andCoordinates:(CLLocationCoordinate2D)coordinate;{

    self  = [super init];
    if(self){
        _title = title;
        _subtitle = subTitle;
        _coordinate = coordinate;
    }
    return self;
}
@end

Local Notification

 AppDelegate.m

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    return YES;
}
                           
- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
   
   
    NSDate *alarmTime = [[NSDate date]dateByAddingTimeInterval:5.0];
    UIApplication *app = [UIApplication sharedApplication];
    UILocalNotification *notifyAlarm = [[UILocalNotification alloc]init];
    if(notifyAlarm){
        notifyAlarm.fireDate = alarmTime;
        notifyAlarm.timeZone = [NSTimeZone defaultTimeZone];
        notifyAlarm.repeatInterval = 0;
        notifyAlarm.soundName = @"";
        notifyAlarm.alertBody = @"Hello Notification";
        [app scheduleLocalNotification:notifyAlarm];
    }
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    UIApplication *app = [UIApplication sharedApplication];
    NSArray *oldnotification = [app scheduledLocalNotifications];
    if([oldnotification count]>0)
    {
        [app cancelAllLocalNotifications];
    }
   
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

Thursday, 25 June 2015

Sqlite DataBase(Save And Find)

ViewController.h

#import <UIKit/UIKit.h>
#import <sqlite3.h>

@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutlet UITextField *name;
@property (strong, nonatomic) IBOutlet UITextField *address;
@property (strong, nonatomic) IBOutlet UITextField *phone;
@property (strong, nonatomic) IBOutlet UILabel *status;

- (IBAction)SaveData:(id)sender;
- (IBAction)FindData:(id)sender;



@property (strong, nonatomic) NSString *databasePath;
@property (nonatomic) sqlite3 *contactDB;

@end


ViewController.m

 #import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
   
    NSString *docsDir;
    NSArray *dirPaths;
   
    // Get the documents directory
    dirPaths = NSSearchPathForDirectoriesInDomains(
                                                   NSDocumentDirectory, NSUserDomainMask, YES);
   
    docsDir = dirPaths[0];
   
    // Build the path to the database file
    _databasePath = [[NSString alloc]
                     initWithString: [docsDir stringByAppendingPathComponent:
                                      @"user.sqlite"]];
   
    NSFileManager *filemgr = [NSFileManager defaultManager];
   
    if ([filemgr fileExistsAtPath: _databasePath ] == NO)
    {
        const char *dbpath = [_databasePath UTF8String];
       
        if (sqlite3_open(dbpath, &_contactDB) == SQLITE_OK)
        {
            char *errMsg;
            const char *sql_stmt =
            "CREATE TABLE IF NOT EXISTS CONTACTS (ID INTEGER , NAME TEXT, ADDRESS TEXT, PHONE TEXT)";
           
            if (sqlite3_exec(_contactDB, sql_stmt, NULL, NULL, &errMsg) != SQLITE_OK)
            {
                _status.text = @"Failed to create table";
            }
            sqlite3_close(_contactDB);
        } else {
            _status.text = @"Failed to open/create database";
        }
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)SaveData:(id)sender {
    sqlite3_stmt    *statement;
    const char *dbpath = [_databasePath UTF8String];
   
    if (sqlite3_open(dbpath, &_contactDB) == SQLITE_OK)
    {
       
        NSString *insertSQL = [NSString stringWithFormat:
                               @"INSERT INTO CONTACTS (name, address, phone) VALUES (\"%@\", \"%@\", \"%@\")",
                               _name.text, _address.text, _phone.text];
       
        const char *insert_stmt = [insertSQL UTF8String];
        sqlite3_prepare_v2(_contactDB, insert_stmt,
                           -1, &statement, NULL);
        if (sqlite3_step(statement) == SQLITE_DONE)
        {
            _status.text = @"Contact added";
            _name.text = @"";
            _address.text = @"";
            _phone.text = @"";
        } else {
            _status.text = @"Failed to add contact";
        }
        sqlite3_finalize(statement);
        sqlite3_close(_contactDB);
    }
}

- (IBAction)FindData:(id)sender {
    const char *dbpath = [_databasePath UTF8String];
    sqlite3_stmt    *statement;
   
    if (sqlite3_open(dbpath, &_contactDB) == SQLITE_OK)
    {
        NSString *querySQL = [NSString stringWithFormat:
                              @"SELECT address, phone FROM contacts WHERE name=\"%@\"",
                              _name.text];
       
        const char *query_stmt = [querySQL UTF8String];
       
        if (sqlite3_prepare_v2(_contactDB,
                               query_stmt, -1, &statement, NULL) == SQLITE_OK)
        {
            if (sqlite3_step(statement) == SQLITE_ROW)
            {
                NSString *addressField = [[NSString alloc]
                                          initWithUTF8String:
                                          (const char *) sqlite3_column_text(
                                                                             statement, 0)];
                _address.text = addressField;
                NSString *phoneField = [[NSString alloc]
                                        initWithUTF8String:(const char *)
                                        sqlite3_column_text(statement, 1)];
                _phone.text = phoneField;
                _status.text = @"Match found";
            } else {
                _status.text = @"Match not found";
                _address.text = @"";
                _phone.text = @"";
            }
            sqlite3_finalize(statement);
        }
        sqlite3_close(_contactDB);
    }
}
@end

Map View

ViewController.h

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface MapViewController : UIViewController<CLLocationManagerDelegate,MKMapViewDelegate,MKAnnotation>
{
    IBOutlet MKMapView *MpData;
    CLLocationManager *locationManager;
}
@end


ViewController.m

#import "MapViewController.h"

@interface MapViewController ()
{
    MKPinAnnotationView *pinView;
    CLLocation *currentLocation ;
    MKPointAnnotation *myAnnotation;
    UISegmentedControl *segmentedControl;
}
@end

@implementation MapViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
   
    NSArray *itemArray = [NSArray arrayWithObjects: @"Red", @"Green", @"Purple", nil];
    segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
    segmentedControl.frame = CGRectMake(35, 70, 250, 35);
    segmentedControl.segmentedControlStyle =UISegmentedControlStylePlain;
    [segmentedControl addTarget:self action:@selector(MySegmentControlAction:) forControlEvents: UIControlEventValueChanged];
    segmentedControl.selectedSegmentIndex = 0;
    [self.view addSubview:segmentedControl];
  
   // [self.view addSubview:scroll];
     locationManager = [[CLLocationManager alloc] init];
    [self CurrentLocation];
  
    myAnnotation = [[MKPointAnnotation alloc] init];
    myAnnotation.coordinate = CLLocationCoordinate2DMake(currentLocation.coordinate.latitude, currentLocation.coordinate.longitude);
   
    myAnnotation.title = @"Hi.Pin Demo";
    myAnnotation.subtitle = @"Change Pin Color ";
    myAnnotation.coordinate=MpData.centerCoordinate;
    [MpData addAnnotation:myAnnotation];
   
   
    // Do any additional setup after loading the view.
}
- (void)MySegmentControlAction:(UISegmentedControl *)segment
{
    //MKPinAnnotationView *result = [[MKPinAnnotationView alloc] initWithAnnotation:myAnnotation reuseIdentifier:Nil];
    //[myAnnotation setCoordinate:currentLocation.coordinate];
    if(segment.selectedSegmentIndex == 0)
    {
        //result.backgroundColor=[UIColor redColor];
        pinView.pinColor=MKPinAnnotationColorRed;

    }
    else if(segment.selectedSegmentIndex==1)
    {
        //result.backgroundColor=[UIColor greenColor];
        pinView.pinColor=MKPinAnnotationColorGreen;
    }
    else if (segment.selectedSegmentIndex==2)
    {
       // result.backgroundColor=[UIColor blueColor];
         pinView.pinColor=MKPinAnnotationColorPurple;
    }
}

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotationPoint
{
    static NSString *annotationIdentifier = @"annotationIdentifier";
   
    pinView = [[MKPinAnnotationView alloc]initWithAnnotation:annotationPoint reuseIdentifier:annotationIdentifier];
    pinView.pinColor = MKPinAnnotationColorPurple;
    return pinView;
}

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    NSLog(@"didUpdateToLocation: %@", newLocation);
    currentLocation = newLocation;
   
   /* if (currentLocation != nil) {
        longitudeLabel.text = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.longitude];
        latitudeLabel.text = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude];
    }*/
   
}
- (void)CurrentLocation
{
    locationManager.delegate = self;
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
   
    [locationManager startUpdatingLocation];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end