Page 198 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 198
Principles of Software Engineering
Notes are associated with the class Account. In addition, the keyword balance (noun) is associated
with the functiongetBalance (), because that function’s name contained a match to the keyword.
Class. (See Figure 9.13)
class Account {
private:
int type; // 0=savings, 1=checking
float interestRate;
float balance;
public:
float getBalance();
Figure 9.13: Illustration of semMet Processing a Bank
Account Code Example
Then, inference occurs from the interface layer of keywords to the conceptual graph layer. In this
case, the weighted links from the account (noun), savings (adjective), and checking (adjective)
keywords meet the threshold of 1.0 for the Account concept to be matched. Also, the interest
(adjective) and rate (noun) keywords meet the threshold for the Interest concept and the balance
(noun) keyword meets the threshold for the Balance concept to be matched. Therefore, the
Account, Interest, and Balance concepts are associated with the class Account. Similarly, the
Balance concept is associated with the getBalance function, since its name matched the balance
(noun) keyword, which met the threshold for the Balance concept. From there, further differencing
can occur within the conceptual graph layer. In this case, the link from the Account concept is
fired, but it does not have enough weight to meet the threshold for the Bank Account concept,
so the Bank Account concept is not matched.
The end result of this example is that the Account class is associated with the Account, Interest,
and Balance concepts, and the account (noun), savings (adjective), checking (adjective), interest
(adjective), rate (noun), and balance (noun) keywords. The getBalance () function is associated
with the Balance concept and the balance (noun) keyword. This information is then used to
calculate semantic metrics.
192 LOVELY PROFESSIONAL UNIVERSITY