\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Jacek Gebal (jgebal)} \pdfinfo{ /Title (utplsql-v2-vs-ruby-plsql-feature-comparison.pdf) /Creator (Cheatography) /Author (Jacek Gebal (jgebal)) /Subject (utPLSQL v2 vs. ruby-plsql feature comparison Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{B69FED} \definecolor{LightBackground}{HTML}{F5F3FC} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{utPLSQL v2 vs. ruby-plsql feature comparison Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Jacek Gebal (jgebal)} via \textcolor{DarkBackground}{\uline{cheatography.com/22528/cs/4908/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Jacek Gebal (jgebal) \\ \uline{cheatography.com/jgebal} \\ \uline{\seqsplit{www}.oraclethoughts.com} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 17th August, 2015.\\ Updated 25th April, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{5.3984 cm} x{5.7358 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Generic}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Installation} & per DB instance & per client \seqsplit{(developer/CI} server) \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} Cross sessions testing & NO & YES \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} Cross database testing & NO & YES \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} Can be used for privileges testing & NO & YES \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} Can be used for VPD/RLS testing & NO & YES \tn % Row Count 15 (+ 3) % Row 6 \SetRowColor{LightBackground} Exception handling & Poor & Full stack trace \tn % Row Count 17 (+ 2) % Row 7 \SetRowColor{white} Test - tested code isolation & Low & High \tn % Row Count 20 (+ 3) % Row 8 \SetRowColor{LightBackground} Runs with invalid DB \seqsplit{dependencies} & NO \seqsplit{(disappearing} tests) & YES \tn % Row Count 23 (+ 3) % Row 9 \SetRowColor{white} Runs without tested DB objects / code & NO \seqsplit{(disappearing} tests) & YES \tn % Row Count 27 (+ 4) % Row 10 \SetRowColor{LightBackground} Migration across databases & Needs installation of framework and tests & Trivial. Change of connect string \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.3984 cm} x{5.7358 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Generic (cont)}} \tn % Row 11 \SetRowColor{LightBackground} Test language maturity & Low & Industry standard \tn % Row Count 2 (+ 2) % Row 12 \SetRowColor{white} Performance & Excellent (100\% in database) & Sufficient\{\{nl\}\}Suffers from network overhead\{\{nl\}\}Suffers from Ruby startup (2-5 secs) \tn % Row Count 9 (+ 7) % Row 13 \SetRowColor{LightBackground} Cucumber support & NO & YES \tn % Row Count 11 (+ 2) % Row 14 \SetRowColor{white} Suitable for integration testing & NO & YES \tn % Row Count 14 (+ 3) % Row 15 \SetRowColor{LightBackground} Community Activity & Low & Low for ruby-plsql\{\{nl\}\}High for RSpec \tn % Row Count 17 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.2297 cm} x{5.9045 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Assertions}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Assertion types & Two\{\{nl\}\}One for equality based matchers\{\{nl\}\}One to check if expression evaluates to TRUE & Multiple assertions(matchers)\{\{nl\}\}\textless{},\textgreater{},=,!=,inclusion,regexp,datatype(class),... \tn % Row Count 9 (+ 7) % Row 2 \SetRowColor{LightBackground} Assertion definition & Defined per datatype & Defined per operator \tn % Row Count 11 (+ 2) % Row 3 \SetRowColor{white} Assertions are used the same way & NO\{\{nl\}\}Different usage depending on compared type & YES\{\{nl\}\}All assertions follow common pattern \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} Assertion on User Defined Type data & NO & YES \tn % Row Count 18 (+ 3) % Row 5 \SetRowColor{white} Assertion on Collection Type data & YES (cumbersome and undocumented usage) & YES \tn % Row Count 21 (+ 3) % Row 6 \SetRowColor{LightBackground} Assertion on PL/SQL records data & YES (cumbersome and undocumented usage) & YES \tn % Row Count 24 (+ 3) % Row 7 \SetRowColor{white} Assertion on Cursor data & YES (complex usage) & YES \tn % Row Count 26 (+ 2) % Row 8 \SetRowColor{LightBackground} Assertion on complex structured data & NO & YES \tn % Row Count 29 (+ 3) % Row 9 \SetRowColor{white} Assertion on \seqsplit{TIMESTAMP/CLOB/BLOB/RAW} & NO & YES \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.2297 cm} x{5.9045 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Assertions (cont)}} \tn % Row 10 \SetRowColor{LightBackground} Assertion on success (no exception) & NO & YES \tn % Row Count 3 (+ 3) % Row 11 \SetRowColor{white} Can tests table/view structure & NO & YES \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Test structure}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Physical test location & Tests located in database schemes / packages or procedures & Yests organized in project into folders/spec files \tn % Row Count 7 (+ 5) % Row 2 \SetRowColor{LightBackground} Physical test organization & Strict - database oriented\{\{nl\}\}Schema/package/procedure & Flexible - project oriented\{\{nl\}\}Within a test file, tests organized into nestable example groups \tn % Row Count 15 (+ 8) % Row 3 \SetRowColor{white} Logical test organization & Limited to package level grouping\{\{nl\}\} Packages can be organized into suites\{\{nl\}\} Each suite can contain many packages\{\{nl\}\} Each package can be placed in many suites & Flexible\{\{nl\}\} Each \seqsplit{test(example)} can be labelled with tags\{\{nl\}\} Each example group can be labelled with tags\{\{nl\}\} Each tag can be assigned to many \seqsplit{tests/example} groups \tn % Row Count 29 (+ 14) % Row 4 \SetRowColor{LightBackground} Test execution granularity & All tests in a single test package\{\{nl\}\}or All tests in a single suite of test packages & Single test\{\{nl\}\} or All tests in a specified example group\{\{nl\}\} or All tests in a \seqsplit{mask-specified} directory/file\{\{nl\}\} or All test with a specific tag(s)\{\{nl\}\} or All tests except specific tag(s)\{\{nl\}\} and more \tn % Row Count 46 (+ 17) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Test structure (cont)}} \tn % Row 5 \SetRowColor{LightBackground} Identifying and naming tests & Each assertion has a mandatory text description\{\{nl\}\}Assertion is a test & Each example group can have a descriptive free text name\{\{nl\}\} Each example can have a descriptive free text name\{\{nl\}\} Each example can contain many assertions composing the test \tn % Row Count 14 (+ 14) % Row 6 \SetRowColor{white} Re-usable tests/shared examples & NO\{\{nl\}\}Separate tests are needed for two functions do the same thing but on different \seqsplit{objects(datatypes)} & YES\{\{nl\}\}Standard of shared examples for testing of identical behavior on different \seqsplit{objects(datatypes)} \tn % Row Count 23 (+ 9) % Row 7 \SetRowColor{LightBackground} Test suites definition & Defined in database tables & Defined as tags in test definition files or by test file location in directory structure \tn % Row Count 30 (+ 7) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Test structure (cont)}} \tn % Row 8 \SetRowColor{LightBackground} Suites management & Calls to API prior to test execution, persisted in DB per user & Tags defined beside the test definition in test files \tn % Row Count 5 (+ 5) % Row 9 \SetRowColor{white} Reporting \seqsplit{configuration} & Calls to API prior to test execution, persisted in DB per user & Parameter when executin tests \tn % Row Count 10 (+ 5) % Row 10 \SetRowColor{LightBackground} \seqsplit{Customizations} within \seqsplit{test/suite/project} & NO\{\{nl\}\}One common library per database & YES\{\{nl\}\}Own \seqsplit{assertions/configurations} can be added to tests or project \tn % Row Count 16 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.2297 cm} x{5.9045 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Test execution}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Needs compilation prior to execution & YES & NO \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} Test invocation & - connect to DB\{\{nl\}\}- call API to execute package or suite & execute "rspec" from command prompt in project root \tn % Row Count 10 (+ 5) % Row 3 \SetRowColor{white} Default tests execution scope & NONE\{\{nl\}\}You need to explicitly state either a suite or a package to be tested' & All test for project\{\{nl\}\}By default, calling "rspec" command from project root will exeute all tests for project \tn % Row Count 19 (+ 9) % Row 4 \SetRowColor{LightBackground} Parallel test executiuon & Doable - do it yourself.\{\{nl\}\}By splitting test into separate suites and running them from CI in parallel jobs. & YES-automatic\{\{nl\}\}with open-source libraries \tn % Row Count 27 (+ 8) % Row 5 \SetRowColor{white} Transaction management & Manual & Automatic\{\{nl\}\}Conforms with RSpec standard for keeping the object(s) unchanged outside of test scope \tn % Row Count 35 (+ 8) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.2297 cm} x{5.9045 cm} x{5.7358 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Test execution (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Test \seqsplit{setup/cleanup} & One mandatory setup and cleanup per test package.\{\{nl\}\}(Bolierplate code when not used)\{\{nl\}\}Useless when different setup needed for each test. & Optional multiple setups cleanups can be defined on each level of example group.\{\{nl\}\} Two triggering modes can be mixed for setup/cleanup:\{\{nl\}\} - Before all tests in example group\{\{nl\}\} - Before each example group\{\{nl\}\} Setups /cleanups available for entire suite (before suite/after suite)\{\{nl\}\} Setups /cleanups can be invoked with filtering by tags too \tn % Row Count 28 (+ 28) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Reporting}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Build in report types & 3 build-in types:\{\{nl\}\} - screen output to client console\{\{nl\}\} - file output (needs to write to DB server)\{\{nl\}\} - html file output (needs to write to DB server)\{\{nl\}\} Outputs incomplete, console output noisy. & 4 build-in types\{\{nl\}\} - dotted - very dense, useful for developers\{\{nl\}\} - \seqsplit{documentation} - QA text reporting oriented\{\{nl\}\} - HTML - like \seqsplit{documentation} but in publishable form\{\{nl\}\} - JSON - for machine processing \tn % Row Count 19 (+ 17) % Row 2 \SetRowColor{LightBackground} \seqsplit{Extensibility} / third party & Can be extended - do it yourself & Available open-source libraries for other output formatting (like CI JUnit formatters) \tn % Row Count 26 (+ 7) % Row 3 \SetRowColor{white} Build in code coverage generation & NO & YES \tn % Row Count 29 (+ 3) % Row 4 \SetRowColor{LightBackground} Supplies timing for tests & NO & YES \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.7358 cm} x{5.5671 cm} x{5.5671 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Reporting (cont)}} \tn % Row 5 \SetRowColor{LightBackground} Supplies count of tests executed & not directly & YES \tn % Row Count 3 (+ 3) % Row 6 \SetRowColor{white} Full stack trace for exceptions & NO & YES \tn % Row Count 6 (+ 3) % Row 7 \SetRowColor{LightBackground} \seqsplit{Self-documenting} tests / tests \seqsplit{expressivness} & NO\{\{nl\}\} procedure\_name\_30\_char\_limit\{\{nl\}\} no place for test description\{\{nl\}\} description is placed inside single assertion "somewhere inside test code" & YES\{\{nl\}\} tests and example blocks have a "full text descriptive names" \tn % Row Count 18 (+ 12) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.3862 cm} x{6.2419 cm} x{6.2419 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{API}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Feature}} & {\bf{utPLSQL}} & {\bf{ruby-plsql}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Complexity} & Complex and inconsistent & Consistent and dense \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Test coverage for API & NO\{\{nl\}\}Tested manually by users and contributors & YES\{\{nl\}\}API is tested by unit tests \tn % Row Count 8 (+ 4) % Row 3 \SetRowColor{white} Learning curve & High\{\{nl\}\}Mailnly due to inconsistency and workarounds and tricks used to overcome nature and limitations of PL/SQL & Low/medium\{\{nl\}\}Need to learn RSpec and Ruby basics and how to use Array and Hash Objects \tn % Row Count 17 (+ 9) % Row 4 \SetRowColor{LightBackground} IDE support & No IDE support for API itself.\{\{nl\}\}Running tests, reporting from IDE is not supported & Highly supported with JetBrains Rubymine (or IntelliJ)\{\{nl\}\} Ruby, RSpec, Cucumber, Gherkin syntax highlighting and code completion\{\{nl\}\} Test execution, exporting test results Support for \seqsplit{GIT/SVN/Mercurial}, PLSQL, SQL, Jira, Stash\{\{nl\}\} and more (many of free plugins available) \tn % Row Count 37 (+ 20) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.3862 cm} x{6.2419 cm} x{6.2419 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{API (cont)}} \tn % Row 5 \SetRowColor{LightBackground} \seqsplit{Completeness} & Medium & High \tn % Row Count 2 (+ 2) % Row 6 \SetRowColor{white} \seqsplit{Integrates} with CI (Jenkins) & not directly\{\{nl\}\}Doable through external calls with Java and Maven\{\{nl\}\}Integration suffers from API reporting limitations & YES\{\{nl\}\}CI-JUnit Reporter plugins available \tn % Row Count 11 (+ 9) % Row 7 \SetRowColor{LightBackground} \seqsplit{Documentation} & Incomplete online documentation & Everything described by examples\{\{nl\}\}Concept of self documenting tests \tn % Row Count 17 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \end{document}