<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://wiki.gorearaucania.cl/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di</id>
	<title>Jak efektivně ladit JavaScript přímo v prohlížeči - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gorearaucania.cl/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di"/>
	<link rel="alternate" type="text/html" href="https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;action=history"/>
	<updated>2026-08-21T21:05:17Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=122677&amp;oldid=prev</id>
		<title>DanieleSeward44 en 18:51 21 ago 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=122677&amp;oldid=prev"/>
		<updated>2026-08-21T18:51:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revisión del 15:51 21 ago 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Línea 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ladění JavaScriptu v prohlížeči &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každodenní rutinou každého vývojáře. Přesto mnoho začátečníků stále spoléhá na vypisování hodnot do konzole přes console.log &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;při složitějších chybách tápou. Klíčem k rychlému řešení problémů &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aktivní využití nástrojů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které prohlížeč nabízí přímo ve svém vývojářském rozhraní&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nemusíte instalovat nic navíc &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stačí otevřít nástroje &lt;/del&gt;pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vývojáře&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle klávesovou zkratkou F12 nebo Ctrl+Shift+I&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Učte &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;postupně&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte s nadpisy od h1 po h6&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;odstavci&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;seznamy a odkazy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Poté přidejte obrázky a tabulky&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U každého prvku &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;všímejte, jak &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;chová v prohlížeči. Nejdůležitější je pochopit&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každý element je vlastně obdélník – má šířku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;výšku, okraje a vnitřní odsazení&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CSS vlastnosti jako margin&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;padding a border vám dají plnou kontrolu nad tímto rozložením&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typické chyby, které dělá každý začátečník Jednou z nejčastějších chyb je zapomenutí na správné uzavírání značek&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V HTML platí přísné párové značky&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud nějakou zapomenete, může &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozpadnout celá stránka&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále se vyvarujte používání starých tabulkových layoutů – moderní CSS má flexbox &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;grid&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které jsou mnohem flexibilnější &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;snadněji se s nimi pracuje. Také pozor na velikost písma – absolutní hodnoty jako 12px se nemusí dobře škálovat, lepší je používat relativní jednotky jako em, rem nebo procenta&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokrytí testy je jedním z nejčastěji skloňovaných metrik kvality kódu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale málokdo ví&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak ho správně měřit a kdy přestává být vypovídající&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejde o to dosáhnout čísla 100 &lt;/del&gt;%, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale o to, aby testy skutečně chránily před regresemi &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dávaly smysl pro tým&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V tomto článku se podíváme na to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak pokrytí měřit prakticky&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;na co si dát pozor &lt;/del&gt;a kdy &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;už další zvyšování přináší víc škody než užitku&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při ladění se vyvarujte časté chyby – spoléhání na console.log &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produkčním kódu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejenže to zahlcuje konzoli&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;může to také ovlivnit výkon aplikace&lt;/del&gt;. Místo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;toho používejte breakpointy &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud potřebujete dočasné výpisy, vždy je po opravě odstraňte&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále si zvykněte na to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že prohlížeče často rozdělují chyby do dvou kategorií: syntaktické (např. chybějící závorka) &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;běhové (např. volání nedefinované funkce). Syntaktické chyby &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zobrazí hned při načtení skriptu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;běhové až při spuštění dané části kódu. Vždy čtěte celý text chyby – obsahuje název souboru &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číslo řádku, což je první stopa &lt;/del&gt;k &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nalezení problému&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Posledním tipem &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;použití nástroje pro sledování výrazů &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Watch&lt;/del&gt;). &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V panelu Sources si můžete přidat výrazy, jejichž hodnotu chcete sledovat v reálném čase během krokování. Stačí kliknout &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;znaménko plus v sekci Watch a zadat jakýkoliv výraz, např&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;objekt&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;property&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tímto způsobem máte vždy &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;očích kritické hodnoty a nemusíte je ručně vypisovat do konzole. Kombinace breakpointů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podmíněných zastavení a sledování výrazů vám umožní rychle a systematicky odhalit i ty nejzákeřnější chyby&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte tím&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že si předem připravíte rámec setkání. Místo obecné diskuse rozdejte každému tři kartičky nebo sloupce &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dokumentu – jeden pro pozitiva, jeden pro problémy &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden pro návrhy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Určete časový limit, třeba pět minut &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tiché psaní. Tím zajistíte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyjádří i ti&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdo mluví méně&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a zabráníte &lt;/del&gt;tomu, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby diskusi ovládli dominantní jedinci. Po sběru podnětů je společně roztřiďte do kategorií&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba podle procesů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nástrojů nebo spolupráce&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak začít měřit pokrytí smysluplně Základem je vybrat správný nástroj&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který umí měřit pokrytí podle řádků&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vět a podmínek&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro jazyky jako Python se nabízí standardní knihovna pro měření&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pro JavaScript existují nástroje zabudované přímo do testovacích běhů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejdůležitější je měřit pokrytí &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;úrovni jednotkových testů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale také integračních testů – kombinace obojího dá lepší obrázek. Spusťte testy s měřením při každém běhu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne &lt;/del&gt;jen &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;občas&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abyste měli aktuální data&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ukládejte výsledky do reportu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který si tým může prohlížet v rámci CI&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším užitečným nástrojem je podmíněný breakpoint&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud se chyba projevuje pouze při určité hodnotě proměnné (např&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když je user&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;id rovno 42)&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klikněte pravým tlačítkem &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číslo řádku a vyberte „Add conditional breakpoint&amp;quot;. Do pole zadejte podmínku &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;výraz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který se vyhodnotí jako pravda &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nepravda&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Prohlížeč pak zastaví běh pouze tehdy&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když je podmínka splněna&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ušetříte &lt;/del&gt;tím &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spoustu času&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože nemusíte procházet tisíce průchodů smyčkou&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor ale na to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že podmínka se vyhodnocuje při každém průchodu – pokud &lt;/del&gt;obsahuje &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vedlejší efekt &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;např&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;volání funkce)&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;může ovlivnit běh programu&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ladění JavaScriptu není o štěstí&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;o znalosti nástrojů &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;systematickém postupu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Osvojte si práci &lt;/del&gt;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vývojářským rozhraním prohlížeče&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;experimentujte s breakpointy a nekrokujte kód naslepo&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;S trochou cviku budete schopni najít a opravit chyby v řádu minut&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a váš kód bude stabilnější a přehlednější&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;Pokud dotaz běží často se stejnými parametry, zvažte použití připravených příkazů (prepared statements). Databáze si &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uloží &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nemusí &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;znovu parsovat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což u opakovaných dotazů ušetří čas&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A v neposlední řadě se vyhněte použití poddotazů tam, kde je lze nahradit JOINem &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;poddotazy se často provádějí &lt;/ins&gt;pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každý řádek zvlášť&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což je pomalé&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud chcete vidět, co &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;změnilo, použijte git status&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ten ukáže&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; [https://Rikkiepedia.nl/index.php?title=Jak_zorganizovat_pr%C3%A1ci_s_v%C3%ADce_jazyky_v_jednom_projektu úLožNé Prostory V MaléM Bytě] které soubory jsou upravené&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale nezacommitované&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro detailnější přehled slouží git diff, který zobrazí přesné řádky&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Než commitnete, vždy &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;projděte tyto výpisy. Často &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stane&lt;/ins&gt;, že &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;omylem upravíte soubor&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://www.techandtrends.com/?s=kter%C3%BD%20jste který jste] nechtěli&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V takovém případě můžete změny vrátit příkazem git checkout -- soubor&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pozor – to smaže všechny neuložené změny v tomto souboru&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you loved this write-up and you would certainly such as to obtain additional facts pertaining to [http://orasch.com/index.php?title=Benutzer:KennethVoyles Orasch.com] kindly browse through our own internet site. Pomalé SQL dotazy dokážou potrápit každého vývojáře&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Než začnete přidávat další servery nebo měnit architekturu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zkuste &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podívat na samotné dotazy&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Často stačí pár úprav &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;databáze začne reagovat výrazně rychleji. Nejběžnější příčinou pomalosti jsou chybějící indexy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zbytečné operace &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;špatně napsané podmínky&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejprve si osvojte práci s breakpointy. Klikněte na číslo řádku v levém sloupci a tím vytvoříte bod přerušení. Když se pak kód spustí, zastaví se přesně na tomto místě. V tu chvíli se vám zpřístupní panel Scope&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde vidíte aktuální hodnoty všech proměnných v dané funkci i globální objekt. Pokud chcete projít kód krok za krokem&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[https://www.biggerpockets&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;com/search?utf8=%E2%9C%93&amp;amp;term=pou%C5%BEijte%20tla%C4%8D%C3&lt;/ins&gt;%&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ADtka použijte tlačítka] Step over&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Step into &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Step out&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Step over přeskočí volání funkce (provede ji najednou)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Step into vstoupí dovnitř&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Step out vyskočí ven ze současného bloku. Tato trojice pokryje 90 % situací, &lt;/ins&gt;kdy &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;potřebujete sledovat, jak se mění data&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Git je nástroj, který sleduje změny &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;souborech&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastěji se používá pro zdrojový kód&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodí se i na dokumenty či konfigurace&lt;/ins&gt;. Místo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kopií složek typu „projekt_final_v3&amp;quot; získáte čistou historii. Každá změna je zaznamenána s autorem, časem &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;popisem&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Díky tomu můžete kdykoli zjistit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;proč &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;změnilo&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vrátit se &lt;/ins&gt;k &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;starší verzi&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile začnete spolupracovat s dalšími lidmi, budete potřebovat větve. Větev &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;oddělená linie vývoje. Základní větev se jmenuje main &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dříve master&lt;/ins&gt;). &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Novou větev vytvoříte příkazem git branch nazev_vetve a přepnete se &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ni pomocí git checkout nazev_vetve&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Větev použijte pro novou funkci nebo experiment&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Až práci dokončíte, sloučíte ji zpět do hlavní větve příkazem git merge nazev_vetve&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezapomeňte se před mergem přepnout &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cíl&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kam chcete sloučit&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším častým problémem je nevyužití cache prohlížeče. Nastavte správné hlavičky, aby se statické soubory (CSS, JavaScript&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obrázky) ukládaly &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prohlížeči návštěvníka &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nemusely se stahovat znovu při každé návštěvě&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dbejte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;verze souborů měnily při jejich úpravách&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak by se uživatelům zobrazoval zastaralý obsah. To je častá chyba&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která vede k &lt;/ins&gt;tomu, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že si lidé myslí&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že cache nefunguje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a raději ji vypnou&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zaměřte se na indexy a plán dotazu Indexy jsou prvním místem&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kam se vyplatí zaměřit. Bez nich databáze prochází celou tabulku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což je při vyšším počtu záznamů pomalé&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vytvořte index na sloupcích, které používáte v podmínce WHERE&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;JOIN nebo ORDER BY&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor ale &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že každý index zpomaluje zápisy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže ho vytvářejte &lt;/ins&gt;jen &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tam&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde dává smysl&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Před nasazením si vždy prohlédněte plán dotazu pomocí příkazu EXPLAIN – ukáže&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde dotaz ztrácí čas&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezapomínejte ani na minimalizaci kódu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Odstraňte z CSS a JavaScriptu zbytečné mezery, komentáře a nevyužité části&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Slučte více souborů do jednoho, abyste snížili počet požadavků na server&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U JavaScriptu dejte přednost asynchronnímu načítání&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby neblokoval vykreslení stránky. A pozor &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;externí skripty &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každý plugin&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;analytický nástroj &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;widget přidává zátěž&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pravidelně kontrolujte, které z nich skutečně potřebujete&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a ty ostatní odstraňte&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Začněte &lt;/ins&gt;tím, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že si Git nainstalujete a otevřete terminál. Přejděte do složky projektu a spusťte git init. Tím vytvoříte skrytou složku &lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;git&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která &lt;/ins&gt;obsahuje &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;celou historii. Pak přidejte soubory do takzvané „stage&amp;quot; příkazem git add . &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tečka znamená vše)&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Následně změny uložíte pomocí git commit -m &amp;quot;popis změny&amp;quot;. Tento trojkrok – init, add&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;commit – budete opakovat neustále&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při návrhu pyramidy myslete na to, že poměr 70/20/10 je pouze výchozí bod&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v praxi závisí na typu projektu. U malé aplikace bez složité logiky můžete mít 80 % integračních testů &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jen 20 % jednotkových&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Naopak u knihovny &lt;/ins&gt;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;matematickými funkcemi dominují jednotkové testy. Důležité je, aby spodní vrstvy běžely rychle – pokud unit test trvá déle než 1 sekundu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejedná se o unit test&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Snažte se udržet celou sadu jednotkových testů pod deseti minutami&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ať je můžete spouštět při každém commitu&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DanieleSeward44</name></author>
	</entry>
	<entry>
		<id>https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=122232&amp;oldid=prev</id>
		<title>KattieBrumby02 en 18:29 21 ago 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=122232&amp;oldid=prev"/>
		<updated>2026-08-21T18:29:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revisión del 15:29 21 ago 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Línea 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr si osvojte práci s konzolí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Kromě běžného &lt;/del&gt;console.log&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, console.warn &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;console&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;error využijte také console&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;table &lt;/del&gt;pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zobrazení polí a objektů v přehledné tabulce&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což je mnohem čitelnější než dlouhý výpis&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pomocí console&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;time &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;console&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;timeEnd změříte dobu provádění úseku kódu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;užitečné při hledání výkonnostních problémů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezapomínejte ani na možnost kopírovat objekt z konzole do schránky pomocí příkazu copy()&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který se hodí při testování nebo posílání dat kolegům. Tyto zdánlivé drobnosti výrazně urychlí vaše každodenní ladění &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pomohou &lt;/del&gt;vám &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychleji najít i ty nejzákeřnější chyby&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Časté &lt;/del&gt;chyby &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a jak je odstranit &lt;/del&gt;Jednou z &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;typických &lt;/del&gt;chyb je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dynamické sestavování dotazů pomocí řetězců&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zejména když potřebujete řadit podle sloupce zvoleného uživatelem&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud uživatel může ovlivnit název sloupce nebo směr řazení&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parametrizace nepomůže&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V takovém případě vždy použijte seznam povolených hodnot, který ověří&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že zadaný řetězec odpovídá skutečnému názvu sloupce. Druhou častou chybou &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zapomínání na vstupy vstupující do LIKE&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;IN &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ORDER BY klauzulí. I zde platí, že místo přímého vkládání vstupu použijte placeholder a pro dynamické části aplikujte whitelist&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při růstu codebase sledujte dva varovné signály: když jednotkové &lt;/del&gt;testy &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začnou vyžadovat složité mockování (např&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pět úrovní mocků)&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;známka špatné architektury – testy vás tlačí k refaktoringu. Když integrační &lt;/del&gt;testy &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začnou být pomalé &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nestabilní (flaky), rozdělte je podle domén nebo použijte testovací kontajnery, ale neodstraňujte je&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je také testy pravidelně profilovat – pokud jeden integrační test trvá minutu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zatímco ostatní sekundy, podívejte se&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jestli nezpůsobuje zbytečné čekání &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;síti nebo na disku&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jako první krok si zvolte testovací framework&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud píšete &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Javě&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sáhněte po JUnit&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v Pythonu po pytestu, v JavaScriptu &lt;/del&gt;po &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jestu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nezáleží &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tom&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který si vyberete, důležitý je princip&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vytvořte nový soubor, který má v názvu slovo „test&amp;quot;, aby ho framework automaticky našel&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Do něj napište funkci nebo metodu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která začíná slovem „test&amp;quot;&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Uvnitř zavolejte testovanou funkci &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;výsledek porovnejte s očekávanou hodnotou pomocí aserce. Například: assert(secitani(2&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3) == 5)&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Než napíšete první unit test&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zapomeňte &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;představu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že testy jsou něco navíc&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jsou to spustitelné dokumentace vašeho kódu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte u malé, izolované funkce, která nemá vedlejší účinky&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ideální &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;čistá funkce&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která přijímá vstup &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vrací výstup. Vyhněte se psaní testů pro třídy s databází, souborovým systémem nebo síťovými voláními. To je integrační testování &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;na to budete potřebovat jiné nástroje&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější začátečnická chyba je commitovat až po 200 změnách najednou&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Git je pak k ničemu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože když se něco rozbije, nevíte, která z těch 200 změn to způsobila. Commit by měl být malý &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;logicky uzavřený: jedna funkce, &lt;/del&gt;jeden &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;opravený překlep&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden styl&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud máte pocit&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je toho moc&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rozdělte si práci na menší kroky&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A nikdy necommitnete &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hlavní větve (obvykle master &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;main) bez předchozí kontroly, co se v ní děje. K tomu slouží větve&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další technikou&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kterou oceníte při ladění složitějších aplikací&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je použití logpointů&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Logpoint je hybrid mezi console.log a breakpointem – místo zastavení běhu programu pouze vypíše hodnotu &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konzole&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ideální pro situace, kdy potřebujete sledovat hodnoty ve smyčce&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nechcete &lt;/del&gt;při &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každé iteraci ručně pokračovat&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nastavíte ho stejně jako breakpoint&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;menu zvolíte možnost Add logpoint a napíšete výraz, který se má vypsat. Tím získáte rychlý přehled bez zbytečného přerušování běhu&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokročilé techniky&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které vám ušetří čas Kromě klasických breakpointů vyzkoušejte podmíněné breakpointy – stačí kliknout &lt;/del&gt;pravým tlačítkem na číslo řádku a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zvolit možnost přidat &lt;/del&gt;podmínku. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Breakpoint se &lt;/del&gt;pak &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aktivuje &lt;/del&gt;pouze tehdy, když je splněna &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vámi zadaná podmínka&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;například když proměnná dosáhne určité hodnoty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To je neocenitelné při ladění cyklů nebo častých funkcí. Dalším užitečným nástrojem je watch expression – v panelu Watch si můžete přidat libovolný výraz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jehož hodnota &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;průběžně aktualizuje &lt;/del&gt;při každém &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kroku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím sledujete klíčové hodnoty bez nutnosti vypisovat je do konzole&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejdůležitější částí testu &lt;/del&gt;není &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;samotný kód&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co testujete&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zaměřte se na hraniční případy: co se stane, když funkce dostane nulu, záporné číslo, prázdný řetězec nebo null? Právě tam se nejčastěji skrývají &lt;/del&gt;chyby&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Napište tři testy pro jednu funkci: jeden pro běžný vstup&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden pro hraniční hodnotu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden pro neočekávaný vstup. Tím zajistíte, že &lt;/del&gt;váš kód &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nefunguje jen pro příklad z tutoriálu, ale i v reálném nasazení&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ladění JavaScriptu v prohlížeči je každodenní rutinou každého vývojáře&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přesto mnoho začátečníků stále spoléhá na vypisování hodnot do konzole přes &lt;/ins&gt;console.log a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;při složitějších chybách tápou&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Klíčem k rychlému řešení problémů je aktivní využití nástrojů, které prohlížeč nabízí přímo ve svém vývojářském rozhraní&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nemusíte instalovat nic navíc – stačí otevřít nástroje &lt;/ins&gt;pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vývojáře&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle klávesovou zkratkou F12 nebo Ctrl+Shift+I.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Učte se postupně&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte s nadpisy od h1 po h6, odstavci, seznamy a odkazy&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Poté přidejte obrázky &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tabulky. U každého prvku si všímejte, jak se chová v prohlížeči&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejdůležitější je pochopit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že každý element &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vlastně obdélník – má šířku, výšku, okraje a vnitřní odsazení&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CSS vlastnosti jako margin&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;padding &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;border &lt;/ins&gt;vám &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dají plnou kontrolu nad tímto rozložením&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typické &lt;/ins&gt;chyby&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, které dělá každý začátečník &lt;/ins&gt;Jednou z &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejčastějších &lt;/ins&gt;chyb je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zapomenutí na správné uzavírání značek. V HTML platí přísné párové značky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud nějakou zapomenete, může se rozpadnout celá stránka&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále se vyvarujte používání starých tabulkových layoutů – moderní CSS má flexbox a grid&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které jsou mnohem flexibilnější a snadněji se s nimi pracuje&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Také pozor na velikost písma – absolutní hodnoty jako 12px se nemusí dobře škálovat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lepší &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;používat relativní jednotky jako em&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rem &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;procenta&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokrytí &lt;/ins&gt;testy &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je jedním z nejčastěji skloňovaných metrik kvality kódu, ale málokdo ví, jak ho správně měřit a kdy přestává být vypovídající&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejde o to dosáhnout čísla 100 %&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale o &lt;/ins&gt;to&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, aby &lt;/ins&gt;testy &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;skutečně chránily před regresemi &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dávaly smysl pro tým&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V tomto článku se podíváme na to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak pokrytí měřit prakticky&lt;/ins&gt;, na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co si dát pozor a kdy už další zvyšování přináší víc škody než užitku&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při ladění se vyvarujte časté chyby – spoléhání na console&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;log &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produkčním kódu. Nejenže to zahlcuje konzoli&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale může to také ovlivnit výkon aplikace. Místo toho používejte breakpointy a pokud potřebujete dočasné výpisy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vždy je &lt;/ins&gt;po &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;opravě odstraňte&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále si zvykněte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že prohlížeče často rozdělují chyby do dvou kategorií: syntaktické (např. chybějící závorka) a běhové (např&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;volání nedefinované funkce)&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Syntaktické chyby se zobrazí hned při načtení skriptu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;běhové až při spuštění dané části kódu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy čtěte celý text chyby – obsahuje název souboru &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;číslo řádku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což je první stopa k nalezení problému&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Posledním tipem je použití nástroje pro sledování výrazů (Watch). V panelu Sources si můžete přidat výrazy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jejichž hodnotu chcete sledovat v reálném čase během krokování. Stačí kliknout &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;znaménko plus v sekci Watch a zadat jakýkoliv výraz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;např&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;objekt&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;property&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tímto způsobem máte vždy na očích kritické hodnoty a nemusíte &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ručně vypisovat do konzole. Kombinace breakpointů&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podmíněných zastavení &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sledování výrazů vám umožní rychle &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;systematicky odhalit i ty nejzákeřnější chyby&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte tím, že si předem připravíte rámec setkání&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo obecné diskuse rozdejte každému tři kartičky nebo sloupce v dokumentu – jeden pro pozitiva&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden pro problémy &lt;/ins&gt;a jeden &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pro návrhy. Určete časový limit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;třeba pět minut na tiché psaní&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím zajistíte&lt;/ins&gt;, že &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se vyjádří i ti, kdo mluví méně, a zabráníte tomu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby diskusi ovládli dominantní jedinci&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Po sběru podnětů je společně roztřiďte &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kategorií, třeba podle procesů, nástrojů &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spolupráce&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak začít měřit pokrytí smysluplně Základem je vybrat správný nástroj&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který umí měřit pokrytí podle řádků&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vět a podmínek&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro jazyky jako Python se nabízí standardní knihovna pro měření, pro JavaScript existují nástroje zabudované přímo &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;testovacích běhů&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejdůležitější &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;měřit pokrytí na úrovni jednotkových testů&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;také integračních testů – kombinace obojího dá lepší obrázek. Spusťte testy s měřením &lt;/ins&gt;při &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každém běhu, ne jen občas, abyste měli aktuální data&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ukládejte výsledky do reportu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který si tým může prohlížet &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rámci CI&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dalším užitečným nástrojem je podmíněný breakpoint. Pokud se chyba projevuje pouze při určité hodnotě proměnné (např. když je user.id rovno 42)&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klikněte &lt;/ins&gt;pravým tlačítkem na číslo řádku a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyberte „Add conditional breakpoint&amp;quot;. Do pole zadejte &lt;/ins&gt;podmínku &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;– výraz, který se vyhodnotí jako pravda nebo nepravda&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Prohlížeč &lt;/ins&gt;pak &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zastaví běh &lt;/ins&gt;pouze tehdy, když je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;podmínka &lt;/ins&gt;splněna&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Ušetříte tím spoustu času&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože nemusíte procházet tisíce průchodů smyčkou&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor ale na to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že podmínka &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhodnocuje &lt;/ins&gt;při každém &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;průchodu – pokud obsahuje vedlejší efekt (např&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;volání funkce), může ovlivnit běh programu&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ladění JavaScriptu &lt;/ins&gt;není &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;o štěstí&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;o znalosti nástrojů a systematickém postupu. Osvojte si práci s vývojářským rozhraním prohlížeče&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;experimentujte s breakpointy a nekrokujte kód naslepo&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;S trochou cviku budete schopni najít a opravit &lt;/ins&gt;chyby &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v řádu minut&lt;/ins&gt;, a váš kód &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bude stabilnější a přehlednější&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KattieBrumby02</name></author>
	</entry>
	<entry>
		<id>https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=121277&amp;oldid=prev</id>
		<title>EMALyn373358: Página creada con «Na závěr si osvojte práci s konzolí. Kromě běžného console.log, console.warn a console.error využijte také console.table pro zobrazení polí a objektů v přehledné tabulce, což je mnohem čitelnější než dlouhý výpis. Pomocí console.time a console.timeEnd změříte dobu provádění úseku kódu, což je užitečné při hledání výkonnostních problémů. Nezapomínejte ani na možnost kopírovat objekt z konzole do schránky pomocí příkazu…»</title>
		<link rel="alternate" type="text/html" href="https://wiki.gorearaucania.cl/mediawiki/index.php?title=Jak_efektivn%C4%9B_ladit_JavaScript_p%C5%99%C3%ADmo_v_prohl%C3%AD%C5%BEe%C4%8Di&amp;diff=121277&amp;oldid=prev"/>
		<updated>2026-08-21T17:44:12Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «Na závěr si osvojte práci s konzolí. Kromě běžného console.log, console.warn a console.error využijte také console.table pro zobrazení polí a objektů v přehledné tabulce, což je mnohem čitelnější než dlouhý výpis. Pomocí console.time a console.timeEnd změříte dobu provádění úseku kódu, což je užitečné při hledání výkonnostních problémů. Nezapomínejte ani na možnost kopírovat objekt z konzole do schránky pomocí příkazu…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Na závěr si osvojte práci s konzolí. Kromě běžného console.log, console.warn a console.error využijte také console.table pro zobrazení polí a objektů v přehledné tabulce, což je mnohem čitelnější než dlouhý výpis. Pomocí console.time a console.timeEnd změříte dobu provádění úseku kódu, což je užitečné při hledání výkonnostních problémů. Nezapomínejte ani na možnost kopírovat objekt z konzole do schránky pomocí příkazu copy(), který se hodí při testování nebo posílání dat kolegům. Tyto zdánlivé drobnosti výrazně urychlí vaše každodenní ladění a pomohou vám rychleji najít i ty nejzákeřnější chyby.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Časté chyby a jak je odstranit Jednou z typických chyb je dynamické sestavování dotazů pomocí řetězců, zejména když potřebujete řadit podle sloupce zvoleného uživatelem. Pokud uživatel může ovlivnit název sloupce nebo směr řazení, parametrizace nepomůže. V takovém případě vždy použijte seznam povolených hodnot, který ověří, že zadaný řetězec odpovídá skutečnému názvu sloupce. Druhou častou chybou je zapomínání na vstupy vstupující do LIKE, IN nebo ORDER BY klauzulí. I zde platí, že místo přímého vkládání vstupu použijte placeholder a pro dynamické části aplikujte whitelist.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Při růstu codebase sledujte dva varovné signály: když jednotkové testy začnou vyžadovat složité mockování (např. pět úrovní mocků), je to známka špatné architektury – testy vás tlačí k refaktoringu. Když integrační testy začnou být pomalé a nestabilní (flaky), rozdělte je podle domén nebo použijte testovací kontajnery, ale neodstraňujte je. Důležité je také testy pravidelně profilovat – pokud jeden integrační test trvá minutu, zatímco ostatní sekundy, podívejte se, jestli nezpůsobuje zbytečné čekání na síti nebo na disku.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Jako první krok si zvolte testovací framework. Pokud píšete v Javě, sáhněte po JUnit, v Pythonu po pytestu, v JavaScriptu po Jestu. Nezáleží na tom, který si vyberete, důležitý je princip. Vytvořte nový soubor, který má v názvu slovo „test&amp;quot;, aby ho framework automaticky našel. Do něj napište funkci nebo metodu, která začíná slovem „test&amp;quot;. Uvnitř zavolejte testovanou funkci a výsledek porovnejte s očekávanou hodnotou pomocí aserce. Například: assert(secitani(2, 3) == 5).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Než napíšete první unit test, zapomeňte na představu, že testy jsou něco navíc. Jsou to spustitelné dokumentace vašeho kódu. Začněte u malé, izolované funkce, která nemá vedlejší účinky. Ideální je čistá funkce, která přijímá vstup a vrací výstup. Vyhněte se psaní testů pro třídy s databází, souborovým systémem nebo síťovými voláními. To je integrační testování a na to budete potřebovat jiné nástroje.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nejčastější začátečnická chyba je commitovat až po 200 změnách najednou. Git je pak k ničemu, protože když se něco rozbije, nevíte, která z těch 200 změn to způsobila. Commit by měl být malý a logicky uzavřený: jedna funkce, jeden opravený překlep, jeden styl. Pokud máte pocit, že je toho moc, rozdělte si práci na menší kroky. A nikdy necommitnete do hlavní větve (obvykle master nebo main) bez předchozí kontroly, co se v ní děje. K tomu slouží větve.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Další technikou, kterou oceníte při ladění složitějších aplikací, je použití logpointů. Logpoint je hybrid mezi console.log a breakpointem – místo zastavení běhu programu pouze vypíše hodnotu do konzole. To je ideální pro situace, kdy potřebujete sledovat hodnoty ve smyčce, ale nechcete při každé iteraci ručně pokračovat. Nastavíte ho stejně jako breakpoint, ale v menu zvolíte možnost Add logpoint a napíšete výraz, který se má vypsat. Tím získáte rychlý přehled bez zbytečného přerušování běhu.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Pokročilé techniky, které vám ušetří čas Kromě klasických breakpointů vyzkoušejte podmíněné breakpointy – stačí kliknout pravým tlačítkem na číslo řádku a zvolit možnost přidat podmínku. Breakpoint se pak aktivuje pouze tehdy, když je splněna vámi zadaná podmínka, například když proměnná dosáhne určité hodnoty. To je neocenitelné při ladění cyklů nebo častých funkcí. Dalším užitečným nástrojem je watch expression – v panelu Watch si můžete přidat libovolný výraz, jehož hodnota se průběžně aktualizuje při každém kroku. Tím sledujete klíčové hodnoty bez nutnosti vypisovat je do konzole.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nejdůležitější částí testu není samotný kód, ale to, co testujete. Zaměřte se na hraniční případy: co se stane, když funkce dostane nulu, záporné číslo, prázdný řetězec nebo null? Právě tam se nejčastěji skrývají chyby. Napište tři testy pro jednu funkci: jeden pro běžný vstup, jeden pro hraniční hodnotu a jeden pro neočekávaný vstup. Tím zajistíte, že váš kód nefunguje jen pro příklad z tutoriálu, ale i v reálném nasazení.&lt;/div&gt;</summary>
		<author><name>EMALyn373358</name></author>
	</entry>
</feed>