how to write test plan code example

Example 1: what is test plan

A Test Plan is a detailed document that describes
the test strategy, objectives, schedule, 
estimation, deliverables, and resources
required to perform testing for a software product

Example 2: what to include in a test plan

Test Plan Identifier
References
Introduction
Test Items
Features To Be Tested
Features Not To Be Tested
Approach
Pass/Fail Criteria
Suspension Criteria
Test Deliverables
Testing Tasks
Environmental Needs
Responsibilities
Staffing and Training Needs
Schedule
Risks and Contingencies
Approvals

Example 3: how to write a test plan

Analyze the product
Design the Test Strategy
Define the Test Objectives
Define Test Criteria
Resource Planning
Plan Test Environment
Schedule & Estimation
Determine Test Deliverables