dimanche 17 mai 2020

Testing algorithm using algorithm testing software

I have created an algorithm to detect all known viruses as part of my thesis. As part of the thesis, I need to test this algorithm and prove to the panel that the algorithm is a working algorithm.

I want to know how I can test this algorithm using any algorithm testing software, produce results out of it, and attach it to my thesis for final defense.

below is the algorithm

/** * Returns the list of all know virus signatures */ private Boolean List getAllVirusSignatures() { //TODO //return the list of all virus signatures in the datastore }

/**
 * Returns true if and only if Program p is infected with Virus V.
 * Checks p against all known Virus signatures in virus signature datastore
 * @param p Program to be checked for virus
 * @return true if Program p is infected with a virus.
 */
private Boolean hasVirus(Program p) {
    List<VirusSignature> virusSignatures = getAllVirusSignatures();
    for(VirusSignature v: virusSignatures) {
        if(VirusFactory.checkForVirus(p, v)) {
            return true;
        }
    }
    return false;
}

/**
 * Detects if Program p is infected with a virus
 * @param p Program to be checked for virus
 * @return true if Program p is infected with a virus
 */
public Boolean detectVirus(Program p) {
    return hasVirus(p);
}

/**
 * Detects if a Set of Programs is infected with a virus
 * @param p A set of programs to be tested for a virus
 * @return ture if a program is infected with a virus
 */
public Boolean detectVirus(List<Program> p) {
    Boolean hasVirus = false;
    for (Program program : p) {
        hasVirus = hasVirus || hasVirus(p);
    }
    ruturn hasVirus;
}

Aucun commentaire:

Enregistrer un commentaire