Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

What is Subsytem Testing for software testing

General Tech QA/Testing

Max. 2000 characters
Replies

usr_profile.png

User

( 5 months ago )

 

What exactly is Subsystem testing and is it any different from Integration Testing? Is subsystem testing just testing that the methods work when the parameters are passed to them?

What would be a good subsystem test for this code

package server.controller;
import server.storage.ParkedUsers;
import java.net.ServerSocket;
import java.net.Socket;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
import server.storage.ParkingSpot;

/**
 * This is the server class that controls all data access and flow.
 * It is also responsible of creating all the parking user objects
 * once it searches them in the FIU Database.
 */
public class AccessControlServer extends Thread
{
    private static ParkedUsers garage = ParkedUsers.instance("garage.txt");
    private final int portNum;
    private PrintWriter sout = null;
    private HashMap<String, PrintWriter> displayConnections 
                                    = new HashMap<String, PrintWriter>();

    /**
     * constructor that initializes the port number variable
     * @param p integer that contains the port number 
     * to which this server will listen to
     */
    public AccessControlServer(int p)
    {
        portNum = p;
        mapConnections();
    }
    /**
     * helper method that maps the text file into the hashmap
     */
    private void mapConnections()
    {

        sout = null;
        displayConnections.put("security", sout);
        for(TreeSet<ParkingSpot> t: garage.values())
            for(ParkingSpot p: t)
            {
                displayConnections.put(p.getParkingNumber(), 
                        p.getPrintWriter());
            }
    }

    @Override
    public void run()
    {
        try
        {
            startServer();
        }
        catch(IOException e)
        {
            System.out.println("Can't listen on port " + portNum);
        }
    }

    /**
     * initializes the server with the specified port number and 
     * starts listening for connections
     * @throws IOException exception thrown if there is a problem 
     * with the server
     */
    public void startServer() throws IOException
    {
        ServerSocket ss = new ServerSocket(portNum);
        while(true)
        {
            Socket s = ss.accept();
            Thread t = new Thread(new ConnectionHandler(s));
            t.start();
        }
    }    

    /**
     * method to send a message to a client
     * @param msg sends a string message to the specified client
     * @param pout the print writer connection to the client
     */
    public void sendMessage(String msg, PrintWriter pout)
    {        
        pout.println(msg);
    }

    /**
     * send the security display the status of all the parking spots
     */
    public void sendStatus()

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif