210 likes | 291 Views
This document provides an overview of the Catalyst Web Framework architecture, focusing on front-end and back-end components, database connections, ORM, MVC structure, testing plans, and utility functions.
E N D
Brendan Heckman Matthew Fusaro Ryan McGivern VMWebMilestone III
A little on the front-end… • Catalyst Web Framework • Similar to Ruby on Rails • Provides framework that will allow us to develop a light-weight web application that • Efficiently communicates with the intermediate database • Translates the database information into objects • Provides a simple and appealing UI for • Visualizing the state of Entities • Performing operations on Entities
And of course MVC… • Model • Access and modify content • Database connection (DBIx::Class) • View • Display data in a meaningful manner • Template Toolkit • Javascript libraries, CSS • Controller • Flow Control • Dispatch actions appropriately and maintain context
DBIx::Class (Perl ORM) • ORM – Object-Relational Mapping • Creates objects associated with tables in a relational database • Database Model • Creates result class file for each table • Corresponds to row-level data in table • Enable this model in the appropriate controllers • Allows the flow control to query data as necessary • Layer of abstraction – remove DB dependence
Test Plan: Front-end • Compatibility • OS Independence • Conduct a complete set of tests on multiple operating systems • Browser compatibility • Implement tests across a set of common browsers • UI Tests • Test UI elements capture and submit user input accurately • Test View components accurately group data
Advantages of Catalyst • Test Anything Protocol (TAP) • Provides test-driven development process • Helper functions add stubs to test directory • Establishes unit tests for inherent operations of each module • One may extend these unit tests if a given object needs to be further interrogated • Functional tests are therefore automatically created • Need only conduct behavior testing • i.e Does flow control behave as expected
Test Plan: Scheduler • Black-box test • Internal logic of the scheduler is not relevant to external components • Test sets • Submit correctly configured jobs into into DB • Does job checking logic pick them up correctly • Monitor end results and catch errors coming out other side • Submit malformed jobs into DB • Confirm that errors are handled as expected in job validation • Deliberately submit jobs that will create exceptions on ESX server • i.e Job is validated according to API but rejected by ESX server • Overload the job queue • Test further submitted jobs wait to enter queue
Test Plan: DB Connector • White-box test • Component most vulnerable to data-integrity loss • Requires test set for complete statement coverage • DBMysqlAdapter class • Create a unit test that will run each of the methods that modifies or pulls information from the database and check that the results are what is desired.
Test Plan: Inventory • Black-box test • Executes task when asked to and returns data • Test set • Call the inventory collector and ask it to do the inventory. When done, print the structures it creates and make sure the data matches what the ESX server reports. • Call the inventory collector while another job is being processed on the ESX server and see if we get I/O errors.
Test Plan: Inventory • White-box test • To ensure object properties fall through conditional branches correctly • Test set • Modify data on the ESX server so some values are either absent or out of bounds. We can utilize the printMe() function to show any errors • Pass malformed data to the functions and make sure it handles the data appropriately.
Test Plan: Utility functions • Virtual Machine • Power On • Power Off • Reboot • Suspend • Rename • Delete • Unregister • Host • Power On • Power Off • Reboot • Maintenance-mode • Stand-by • Resource Pool • Configure • Relocate
Test Plan: Utility functions • Black-box test • Accuracy of utility function tested by performing operations on existing VMs, hosts, or resource pools • Test set • Unit test that covers all utility functions • Confirm each function performs its respective action